-
Notifications
You must be signed in to change notification settings - Fork 214
Style loader for sass / scss does not work #1066
Comments
Hi! Both of those packages are third-party and don't look actively maintained. For example Similarly, Generally when the peer dependency versions do not match, it's not guaranteed that things will work. As such, it's worth watching the npm/yarn install log, since they will warn about version mismatches like this :-) Thankfully for Neutrino 8, Could you try removing the third party presets and following the steps in the Neutrino docs, and let us know how you get on? |
eg: module.exports = {
use: [
['@neutrinojs/react', {
// These options get passed down to `@neutrinojs/style-loader`
style: {
// ...
}
}]
]
}; |
Thank you for your reply. I removed those two third-parties and tried again. But it still did not work. My neutrino.js was:
In addition to this, the way I've tried is shown in my neutrino.js. https://github.com/YahngSungho/dfsfdsfsfdsfwfsd/blob/help_style_loader/.neutrinorc.js |
I've checked out the repository linked above (very useful to have it - thank you!). I had to modify the There appears to be three separate issues:
Looking at the SASS docs, it seems that .styleTest1
background-color: firebrick
I'll open a PR to fix the docs for (3). |
@edmorley Thank you for your detailed and kind answers. But nevertheless this doesn't work. The same error message still appears. Could you check it one more time? The part I changed can be found in the repo: Especially in neutrino.js: |
Since `postcss-loader` must be applied *after* `sass-loader` (and before `css-loader`) according to: https://github.com/postcss/postcss-loader#config-cascade ...whereas previously it was being applied *before* `sass-loader`, since webpack applies loaders in the order of "last to first". See: #1066 (comment)
…1077) Since `postcss-loader` must be applied *after* `sass-loader` (and before `css-loader`) according to: https://github.com/postcss/postcss-loader#config-cascade ...whereas previously it was being applied *before* `sass-loader`, since webpack applies loaders in the order of "last to first". See: #1066 (comment) This is the `release/v8` backport of #1076.
I've not solved this problem yet. Does anyone know how to solve it, please? |
Sorry for the delayed reply - I've been focusing on the Neutrino 9 release (beta in #1129). Trying the testcase branch now, trying to run I had to install that dependency manually using After that, I then get: Which is due to the bug in the testcase mentioned here: Manually adding a module.exports = {
options: {
mains: {
index: './components/style-loader-test.story.js',
},
},
use: [
// ...
]
}; ...I then get this error: This is because Installing the missing dependency using
In case it was actually
ie: I can't reproduce this issue. Could you try again and if it still occurs for you, update the testcase so it reproduces the problem? The testcase also needs to be working out of the box (no fixes/adding missing dependencies should be required after cloning). One thing I did spot though (that is unrelated to the error above), when inspecting the generated config (using
This is because there is a typo in |
@edmorley I appreciate your answers. Saved me tons of time. |
In my opinion, I've tried all the methods I've found to use the sass / scss loader. But it did not work in the end.
Someone please check...
I created an example repo:
https://github.com/YahngSungho/dfsfdsfsfdsfwfsd/tree/help_style_loader
I installed:
https://www.npmjs.com/package/neutrino-middleware-sass
https://www.npmjs.com/package/neutrino-preset-sass
My neutrino.js:
https://github.com/YahngSungho/dfsfdsfsfdsfwfsd/blob/help_style_loader/.neutrinorc.js
What I tried:
https://github.com/YahngSungho/dfsfdsfsfdsfwfsd/blob/help_style_loader/src/components/style-loader-test.story.js
What I saw:
The text was updated successfully, but these errors were encountered: