Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade style-loader to 1.0.0? #2227

Closed
AlexVPopov opened this issue Aug 11, 2019 · 10 comments
Closed

Upgrade style-loader to 1.0.0? #2227

AlexVPopov opened this issue Aug 11, 2019 · 10 comments
Labels
dependencies dependency, yarn or other package management help wanted

Comments

@AlexVPopov
Copy link

Hello,

Non-JavaScript person here. On a fresh Rails 6.0.0.rc2 install with webpacker 4.0.7 source maps in Firefox don't work. This is the error, that I get:

Screenshot 2019-08-11 17 22 12

I've found several issues both in style-loader's and Firefox' issue trackers:

webpack-contrib/style-loader#303
https://bugzilla.mozilla.org/show_bug.cgi?id=1451274
https://bugzilla.mozilla.org/show_bug.cgi?id=1543896

According to the Changelog for version 1 of style-loader, the problems with the source maps in Firefox have been fixed:

webpack-contrib/style-loader#383

Would a PR for upgrading the style-loader to 1.0.0 be accepted? As I'm not very experienced with webpack and webpacker, I'm not completely sure how hard that would be, however I think a major implication would be, that the minimum version for Node would have to be bumped to 8.9.0, as the style-loader now requires 8.9.0.

@jakeNiemiec jakeNiemiec added the dependencies dependency, yarn or other package management label Aug 12, 2019
@aried3r
Copy link
Contributor

aried3r commented Aug 13, 2019

however I think a major implication would be, that the minimum version for Node would have to be bumped to 8.9.0, as the style-loader now requires 8.9.0.

Seems like you're in luck! See #2228

@AlexVPopov
Copy link
Author

Does this mean I should submit a PR for upgrading the style-loader?

@aried3r
Copy link
Contributor

aried3r commented Aug 14, 2019

I'm not a maintainer, but yes, I believe a PR would be nice to further discuss this, as we can then see the necessary changes and if they are breaking changes for users of webpack.

If it's possible to write a test or have a sample project which shows the error and the fix it would be even better, if possible :)

@jakeNiemiec
Copy link
Member

Looks like you just need to remove 2 options that are no longer needed according to: https://github.com/webpack-contrib/style-loader/blob/master/CHANGELOG.md#breaking-changes

image

@AlexVPopov I encourage you to open a PR for upgrading style-loader to 1.0.0

@smondal
Copy link
Contributor

smondal commented Aug 19, 2019

I have created pull request against this issue.
#2242

Thanks

@mgiraldo
Copy link

@AlexVPopov i am getting a similar error (v4.0.7) . did you finally get to remove this warning?

@AlexVPopov
Copy link
Author

AlexVPopov commented Oct 11, 2019 via email

@mgiraldo
Copy link

this warning doesn't show up in production so i'm not going to worry about it for now

@saiqulhaq
Copy link

@smondal I pulled latest webpacker code, but still doesn't work

following is the error:

ERROR in xxx.vue?vue&type=style&index=0&id=20cc00ea&lang=scss&scoped=true& (./node_modules/style-loader/dist??ref--3-0!./node_modules/css-loader??ref--3-1!./node_modules/vue-
loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--3-2!./node_modules/sass-loader/lib/loader.js??ref--3-3!./node_modules/vue-loader/lib??vue-loader-options!.xxx.vue?vue&type=style&index=0&id=20cc00ea&lang=scss&scoped=true&)
Module build failed (from ./node_modules/style-loader/dist/index.js):
ValidationError: Invalid options object. Style Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'sourceMap'. These properties are valid:
   object { injectType?, attributes?, insert?, base? }
    at validate (node_modules/style-loader/node_modules/schema-utils/dist/validate.js:50:11)
    at Object.loader (node_modules/style-loader/dist/index.js:17:28)

I still have no idea where is sourceMap property is defined

@guillaumebriday
Copy link
Member

It has been done since this issue! 👍

https://github.com/rails/webpacker/blob/5-x-stable/package.json#L47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies dependency, yarn or other package management help wanted
Projects
None yet
Development

No branches or pull requests

7 participants