Skip to content
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

react app route problem #810

Open
AliElkishawi opened this issue Sep 9, 2024 · 3 comments
Open

react app route problem #810

AliElkishawi opened this issue Sep 9, 2024 · 3 comments

Comments

@AliElkishawi
Copy link

when I used the serve to deploy my react app it was worked but when I insert my own route in browser its giving me a blank page " white screen "
if go to my.domain.com/first_route ---> its worked
but go to my.domain.com/first_route/second_route ---> giving me a blank screen

and thanks alot

@JGuillenY
Copy link

Not sure if this was already resolved, but for serving SPAs, you just have to add the -s option. According to the documentation:
-s, --single Rewrite all not-found requests to index.html``

With that flag you shouldn't have issues.

@ericlau-solid
Copy link

The solution for worked great for me. I say this issue can be closed. Perhaps put this in readme file? Serving SPAs are common.

@esetnik
Copy link

esetnik commented Feb 20, 2025

Something is weird with the -s flag it will not serve a html file named other.html in the root directory. Instead it serves index.html. It should only be rewriting not found requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants