I was able to replicate your issue. The problem is serve. When you run serve -s build it starts the HTTP server. When you go to http://localhost:5000 in your browser it sends an HTTP request for / to serve. It will respond with ./build/index.html, which references assets from /newroot/static/..... But, there is no newroot directory inside your build directory. So it responds with ./build/index.html due to the -s flag.
If you rename the build directory to newroot and run serve . then you will be able to load your application at localhost:5000/newroot but navigation may not work correctly depending on what you are doing.
If you are trying to test the production deployment of your application you should do so in a production-like environment, not locally.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was able to replicate your issue. The problem is
serve
. When you runserve -s build
it starts the HTTP server. When you go tohttp://localhost:5000
in your browser it sends an HTTP request for/
to serve. It will respond with./build/index.html
, which references assets from/newroot/static/....
. But, there is nonewroot
directory inside yourbuild
directory. So it responds with./build/index.html
due to the-s
flag.If you rename the
build
directory tonewroot
and runserve .
then you will be able to load your application at localhost:5000/newroot but navigation may not work correctly depending on what you are doing.If you are trying to test the production deployment of your application you should do so in a production-like environment, not locally.