Webpacker: Upgrade style-loader to 1.0.0?

Created on 11 Aug 2019  Â·  9Comments  Â·  Source: rails/webpacker

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:

https://github.com/webpack-contrib/style-loader/issues/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:

https://github.com/webpack-contrib/style-loader/pull/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.

dependencies help wanted

All 9 comments

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 https://github.com/rails/webpacker/pull/2228

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

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 :)

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

I have created pull request against this issue.
https://github.com/rails/webpacker/pull/2242

Thanks

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

Haven't got the chance to try this yet.

On Fri, Oct 11, 2019, 2:48 AM Mauricio Giraldo notifications@github.com
wrote:

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

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rails/webpacker/issues/2227?email_source=notifications&email_token=AAYW2VEOVGPGC7RMIUQPESTQN65N5A5CNFSM4IK35TQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA6J4EI#issuecomment-540843537,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAYW2VGGDNV46TF2NAV3Z2LQN65N5ANCNFSM4IK35TQQ
.

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

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suhomozgy-andrey picture suhomozgy-andrey  Â·  3Comments

eriknygren picture eriknygren  Â·  3Comments

towry picture towry  Â·  3Comments

christianrojas picture christianrojas  Â·  3Comments

amandapouget picture amandapouget  Â·  3Comments