Closed yss14 closed 9 months ago
@yss14 decorators
should be an array. Try this instead:
decorators: [
(Story) => {
return (
<NextIntlClientProvider locale={'en'}>
<Story />
</NextIntlClientProvider>
)
}
],
Closing for now, but LMK if this doesn't work and we can re-open.
Describe the bug
I just wanted to setup storybook for our NextJS project (with TypeScript). Setup via
npx storybook@latest init
worked fine. I just had to do two minor changes to the default configuration to get the studio up and running.const config: StorybookConfig = { stories: ['../src/*/.mdx', '../src/*/.stories.@(js|jsx|mjs|ts|tsx)'], addons: [ '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-onboarding', '@storybook/addon-interactions', ], framework: { name: '@storybook/nextjs', options: {}, }, docs: { autodocs: 'tag', }, webpackFinal: async (config) => { config.resolve.modules = [...(config.resolve.modules || []), path.resolve(__dirname, '../src')]
}, } export default config
Now every time I open some story preview the following runtime error is showing up:
Even for the build-in example stories.
To Reproduce
Hard to provide a full reproduction repository, since it's a complex commercial project. What I tried is to setup storybook on a new greenfield NextJS repository including the custom adjustments to the config and there the issue is not popping up. So it must be related to some specifics at our complex commercial project.
System