storybook-preset-craco icon indicating copy to clipboard operation
storybook-preset-craco copied to clipboard

Doesn't work with react-scripts 5 (Webpack 5)

Open kumikumi opened this issue 2 years ago • 6 comments

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

  1. clone it and cd to it
  2. yarn install
  3. yarn storybook

Your environment

node.js version v17.8.0

kumikumi avatar Mar 29 '22 02:03 kumikumi