404 not found static files after npm run build
See original GitHub issueI’ve run the following commands:
create-react-app myApp
cd myApp
npm run build
copy build folder into server
What to do?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
404 Not Found static files React JS | NGINX - Stack Overflow
Running npm run build / yarn build gives you all your source files in a compiled and optimized format. You can put them...
Read more >Nginx not finding react static files (404) - Reddit
I receive a 404 error for my static files in the build folder (I am using npm run build) but I can confirm...
Read more >Deployment | Create React App
Sometimes npm run build works locally but fails during deploy via Heroku. Following are the most common cases. "Module not found: Error: Cannot ......
Read more >404: React Page Not Found - Karen Ying
Netlify's 404 Page. You just deployed your first Create React App to Netlify. Site is live shows up in the scrolling deployment log....
Read more >@mapbox/batfish - npm
Then run npm run start , npm run build , and npm run serve-static ... Export from that page file a React component...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jsantana90 copy the contents of the build directory into htdocs instead of the directory itself; you need to do this until https://github.com/facebookincubator/create-react-app/issues/1094 is resolved.
e.g. instead of
htdocs\build\index.html
andhtdocs\build\static\js\main*.js
you wanthtdocs\index.html
andhtdocs\static\js\main*.js
.Also when you run
npm run build
you should see exact instructions for serving those files on the terminal screen. Have you had a chance to try following them yet? Did you have any issues doing so?