question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 not found static files after npm run build

See original GitHub issue

I’ve run the following commands:

create-react-app myApp

cd myApp

npm run build

copy build folder into server

screen shot 2016-12-05 at 8 51 52 pm

What to do?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
Timercommented, Dec 6, 2016

@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 and htdocs\build\static\js\main*.js you want htdocs\index.html and htdocs\static\js\main*.js.

2reactions
gaearoncommented, Dec 6, 2016

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found