storybook-preset-craco
storybook-preset-craco copied to clipboard
Doesn't work with react-scripts 5 (Webpack 5)
Description
Here's a sample repo with react-scripts 5. Storybook works with "@storybook/preset-create-react-app"
but doesn't work after swapping it to "storybook-preset-craco"
Expected behavior
yarn storybook
makes storybook build successfully.
Actual behavior
Get lots of errors like this:
ModuleNotFoundError: Module not found: Error: You attempted to import /home/path/to/storybook-react-scripts-webpack5/node_modules/@storybook/client-api which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
Steps to Reproduce
Sample repo https://github.com/kumikumi/storybook-craco-react-scripts-webpack5
- clone it and cd to it
- yarn install
- yarn storybook
Your environment
node.js version v17.8.0