score:9

Accepted answer

I found out that if the filenames have uppercase letters on Windows, you get a 404 error.

I changed all filenames to lowercase characters and the 404 errors went away.

score:0

Before starting your application you need to build using npm run build command and then start your application.

score:2

First, you need to understand what kind of app do you want to build. Is it serverless? or kind of with server and what web server do u want to use (there are so many options).

For serverless app:

All you need to do for production build is next export, this function will generate static files to be served as your website. Read more here...

For app with server:

If you want to run npm run start, you need to do npm run build first.

npm run build compiles and optimizes your build for production mode.

npm run start run your web server to serve your html files.

If you have done those two steps, it means something wrong with your server files, your web server's API didn't listen to the request, therefore it doesn't redirect you to the correct page.


Related Query

More Query from same tag