New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create React App CRA - Error: You attempted to import [path/to/app]/node_modules/react/jsx-dev-runtime which falls outside of the project src/ directory #13585
Comments
I have the same issue with yarn, but it's working with npm. |
I am getting this now too and its failing in our CI, which uses npm. But its actually okay on my local machine using yarn/npm. Rerunning older successful builds from a few days ago also resulting in this failure in build-storybook.
Dependencies:
|
Funny behaviour as to what is causing this, this happens in a newly created project, but doesn't have same behaviour with storyshots and jest. |
I am facing same issue here. package.json
main.js
preview.js
.yarnrc.yml
|
If you are not so dependent on CRA you can remove the preset from addons as mentioned here #13583 (comment) |
For me seems to be webpack 4.45.0, fixed it for now with with resolution in package.json
|
Yes same! Seems like @storybook/react should have had exact dependencies. In my case incidentally yarn.lock wasnt checked in. It all adds up. |
to fix "Create React App CRA - Error: You attempted to import.." error of story book reference: storybookjs/storybook#13585 (comment)
Problem is gone with webpack 4.46.0 - no resolutions needed. |
closing as dupe to #13593 |
I'm also having this issue, and I'm using CRA v3, and Storybook v5. |
Issue solved following storybookjs/storybook#13585 (comment)
NOTE: Workaround provided by @JMS-1: #13585 (comment). Instructions at the end of this description on implementing the workaround.
Original Bug
Describe the bug
A vanilla Create React App install with a vanilla Storybook init fails to run.
To Reproduce
Steps to reproduce the behavior:
npx create-react-app my-app
cd my-app
npx sb init
yarn add -D babel-loader@8.1.0
yarn storybook
Expected behavior
Storybook is started
Screenshots
Code snippets
Not applicable
System
Additional context
Generated package.json
Workaround
Workaround provided by @JMS-1: #13585 (comment)
Steps to resolve:
yarn
yarn storybook
Note that this is a workaround while waiting for a longer-term fix. Don't keep this in forever!
The text was updated successfully, but these errors were encountered: