You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works.
Steps to reproduce the behavior
get svelte template npx degit sveltejs/template my-app
navigate to app folder and install storybook cd my-appnpx sb init
add the preset npm i -D @storybook/preset-scss css-loader sass sass-loader style-loader (NOTE: it is missing 'sass' depedency on the exemple at the file readme.md)
install all the dependencies npm i
change the file ./src/stories/button.css to ./src/stories/button.scss and the import at ./src/stories/Button.svelte to match the import file path
add the addon '@storybook/preset-scss', to the addons list at the file .storybook/main.js
run storybook npm run storybook
Expected behavior
To render normaly the button at the storybook's canvas
Screenshots and/or logs
ERROR in ./src/stories/button.scss
Module build failed (from ./node_modules/style-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
at Object.loader (/home/josel/devProjects/test/node_modules/style-loader/dist/index.js:19:24)
@ ./src/stories/Button.svelte 17:0-23
@ ./src/stories/Button.stories.svelte
@ ./src sync ^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(js|jsx|ts|tsx|svelte))$
@ ./.storybook/generated-stories-entry.js
@ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js ./node_modules/@storybook/core-client/dist/esm/globals/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/esm/frameworks/svelte/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js ./node_modules/@storybook/addon-measure/dist/esm/preset/preview.js-generated-other-entry.js ./node_modules/storybook-addon-outline/dist/esm/preset/addDecorator.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined
I recently ran into this issue
I tried switching to webpack 5, but that seems to have compatibility issues with typescript at least for the way I've got this svelte project setup - storybookjs/storybook#15148
so far the above PR seems to be the only fix in combination with webpack 4
Describe the bug
Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works.
Steps to reproduce the behavior
npx degit sveltejs/template my-app
cd my-app
npx sb init
npm i -D @storybook/preset-scss css-loader sass sass-loader style-loader
(NOTE: it is missing 'sass' depedency on the exemple at the file readme.md)npm i
./src/stories/button.css
to./src/stories/button.scss
and the import at./src/stories/Button.svelte
to match the import file path'@storybook/preset-scss'
, to the addons list at the file.storybook/main.js
npm run storybook
Expected behavior
To render normaly the button at the storybook's canvas
Screenshots and/or logs
Environment
Additional context
After changing storybook's bundler to webpack5 (https://github.com/storybookjs/storybook/tree/next/lib/builder-webpack5), and fixing this another issue: storybookjs/addon-svelte-csf#23, everthing works normally.
The text was updated successfully, but these errors were encountered: