-
-
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
Storybook does not serve files from CRA public folder #1537
Comments
Can you try a |
@ndelangen, Thanks for the reply 😄 I have modified my test script to use npm and add your advised install step. Still fails to read file, same as before. Now the script is as follows: npm -v 4.0.2 Also tried create-react-app tester
cd tester
echo "foobar" > public/file
npm start
# in another terminal
curl localhost:3000/file # outputs "foobar" <--- Works as expected
# in first terminal
getstorybook
npm install # <--- no screen output, npm 4: 15 seconds, npm 5: 1 min+ very chatty ,
npm run storybook
# in another terminal
curl localhost:6006/file # outputs "foobar" <--- "Cannot GET /file" More info: I think this may be a configuration problem... Running CRA, Running Storybook Storybook is running and serving data, just not serving from |
Can you check this documentation page, and see if this solves the problem? https://storybook.js.org/configurations/serving-static-files/#docs-content Storybook does not automatically serve the same folder statically as cra. |
RTFM, ugh, 😊 @ndelangen That solves it. Thank you so much for the help 😄 |
My pleasure! |
I attempted to follow "The guidelines for contributing" "Reproductions" script, but I couldn't get that to work, see #1536.
Here's an abbreviated version that describes the problem:
Specifically the error is wrapped in an html file:
I have tried with files of various extensions (.html, .json, .ico, .ttf, .woff, etc.), none are served.
Any ideas on what needs to be done to get Storybook to serve files from a CRA app's public folder and subdirectories?
The text was updated successfully, but these errors were encountered: