Closed equinusocio closed 1 year ago
@equinusocio, this is a case of loaders being applied multiple times. can you share your main.(js|ts)
with me?
import type { StorybookConfig } from '@storybook/react-webpack5';
import path from 'node:path'
const config: StorybookConfig = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
docs: {
autodocs: true,
},
features: {
storyStoreV7: true,
},
addons: [
'@storybook/addon-actions',
'@storybook/addon-links',
'storybook-css-modules-preset',
'storybook-addon-themes',
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
}, {
name: '@storybook/addon-styling',
options: {
cssModules: true,
postCss: {
implementation: require('postcss'),
},
},
},
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: prop => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
webpackFinal: async (config) => {
if (config && config.resolve && config.resolve.alias) {
config.resolve.alias['@/components'] = path.resolve(__dirname, '../src/');
return config;
}
return config;
},
framework: {
name: '@storybook/react-webpack5',
options: {},
},
};
export default config;
Got it. I didn't try to remove addons one by one. The issue is caused by storybook-css-modules-preset
. By removing it everything seems to work as expected. Thanks for the patience
That's great news @equinusocio! I'm glad you got it figured out 🎉
Describe the bug
Error on rendering components with basic CSS (using Postcss and CSS Modules). See screenshot.
Here the CSS file:
Addon configuration:
Steps to reproduce the behavior
Expected behavior
No errors.
Screenshots and/or logs
Environment
Additional context
With the old plugin addon-postcss everything worked as expected.