-
Notifications
You must be signed in to change notification settings - Fork 103
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
SCSS preset is not working with latest node-sass #195
Comments
I tried using
|
In case someone initialised storybook to the existing create-react-app project, do the above (downgrade sass-loader to 10.1.1) and remove Thanks @riccardogiorato & @massivelines |
@mbaranovski can you share your package.json & main,js, having the same issue, doesn't solve the import scss |
I'm guessing this is blocked until webpack 5 is supported in storybook core? There are some improvements in |
This works 👍🏾 |
Can anyone take a look at my
"devDependencies": {
"@babel/core": "^7.14.6",
"@size-limit/preset-small-lib": "^5.0.1",
"@storybook/addon-essentials": "^6.3.0",
"@storybook/addon-info": "^5.3.21",
"@storybook/addon-links": "^6.3.0",
"@storybook/addons": "^6.3.0",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^6.3.0",
"@types/node": "^15.12.5",
"@types/react": "^17.0.11",
"@types/react-dom": "^17.0.8",
"babel-loader": "^8.2.2",
"css-loader": "^5.2.6",
"husky": "^6.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"sass": "^1.35.1",
"sass-loader": "10.1.1",
"size-limit": "^5.0.1",
"style-loader": "^3.0.0",
"tsdx": "^0.14.1",
"tslib": "^2.3.0",
"typescript": "^4.3.4"
},
"dependencies": {
"next": "^11.0.1"
}
module.exports = {
stories: ['../_components/**/*.stories.@(ts|tsx|js|jsx)', '../stories/**/*.stories.@(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-scss'],
typescript: {
check: true, // type-check stories during Storybook build
}
}; |
@PudparK I have same problem, you also need fixed |
@moonou thanks, that fixed it for me. Downgrading sass-loader to v10 alone didn't help. After downgrading style-loader to v2, then the project compiled. Hope this gets more upvotes so people can see how to fix it. |
@moonou I finally got around to trying it out and it did indeed work. Thank you so much! |
Not sure if this will help someone but I had to do a third downgrade before things worked. Here are my steps:
|
This is the solution. Absolutely terrible add-on if the basic readme.md doesn't even work. Here's my full config seen as this is what infuriated me when people post their 'solutions'. main.js module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-scss',
],
}; package.json "dependencies": {,
"sass": "^1.36.0"
},
"devDependencies": {
"@storybook/addon-actions": "^6.3.6",
"@storybook/addon-essentials": "^6.3.6",
"@storybook/addon-links": "^6.3.6",
"@storybook/html": "^6.3.6",
"@storybook/preset-scss": "^1.0.3",
"@storybook/preset-scss": "^1.0.3",
"css-loader": "5.2.6",
"sass-loader": "10",
"style-loader": "2.0.0",
}, If you have the same packages as above it will finally work. Complete waste of many hours due to this stupid plugin. |
Tnx dude |
Please refer to: storybookjs/presets#195
PR created to update preset-scss README
|
I also needed to downgrade |
Do we know if storybook has a plan to update to webpack 5? |
if you get this error
you should use this:
|
This worked for me as well! Thanks. |
Thanks It's working |
This works for me, thanks. |
This one worked for me. After hours of debugging! Thank you. |
The following packages still aren't working with this SCSS preset. After trying the command from lawnchamp. I'm attempting to use builder 5 so, maybe that's what's causing issues? Repo here
|
i solved this problem in webpack version 5,
i hope it was helpful... |
Just my contribution: I have mixed @thewanionly and @MartinDawson approaches main.js
package.json
|
Describe the bug
Possible Fix would be identical to this
npm uninstall -D sass-loader && npm install -D [email protected]
The text was updated successfully, but these errors were encountered: