-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Production build with create-react-app includes story files #12625
Comments
This seems like a pretty big oversight. @mrmckeb any thoughts? |
I'm able to replicate this as follows:
This results in:
|
Happens to me as well |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I also have this issue - after installing storybook into my create-react-app project I can't even run npm start |
I find it interesting you can run a development command ( Is this intended to work @mrmckeb ? |
The issue has 2 possible work-arounds, right now:
Despite the error in the console, the build CRA works!, the output of /build is valid and opens in a browser. I'm not exactly sure what CRA is trying to do with the src/stories contents.. We can't move the stories outside of My main questions are:
I'm not exactly sure how to proceed on the storybook side of things. In any case, @shilman I don't think this is a blocker, since there are clear and easy work-arounds. If anyone disagrees, and thinks there is something actionable by the storybook maintainers, please do let me know. 🙇 |
@ndelangen can you track down @mrmckeb and figure something out together? |
Discussed this with @ndelangen and am in agreement that:
We should chase it down and fix it anyway because it affects our CRA users, but de-prioritizing it for now. |
Interesting, I haven't hit this before... but it could use some investigation. If you'd like to raise an issue at @colinramsay, we can take a look at this on the CRA side: Officially, the CRA team recommend installing everything as "dependencies" anyway as Webpack doesn't differentiate between dependency types, and we know that people hit issues on CI environments when they split things out. So that's obviously the quick fix for this. |
Describe the bug
When running
npm run build
when using create-react-app with TypeScript, I receive errors in my story.tsx files complaining about missing storybook dependencies. This makes sense as the storybook dependencies aredevDependencies
and so not available for a production build.Expected behavior
The story.tsx files should be excluded and a production build should be created.
Steps to replicate
System
I'm not sure if I'm missing something major here!
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: