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

Home page always being returned #561

Open
bruno-silva5 opened this issue Jul 20, 2022 · 8 comments
Open

Home page always being returned #561

bruno-silva5 opened this issue Jul 20, 2022 · 8 comments

Comments

@bruno-silva5
Copy link

Bug Report

Current Behavior
I simply created a create-react-app (using React17) and installed react-snap and react-router-dom. Then I created some simple routes and pages (About, Contact, Home).

After properly configuring the react-snap. I created the static HTML files. But when I access the website with javascript disable, always the Home page is being returned.

For example. If I go to '/about', with Javascript disabled. The HTML of the main page is being returned, even though there is a HTML for the '/about' page.

Reproducible demo
Link to GitHub repository or codesandbox with a demo of the bug behavior.

Expected behavior/code
Expected to return the static HTML for the corresponding route

Additional context/Screenshots
image

@andrewtpoe
Copy link

I'm experiencing this exact same behavior. Have you found a fix for it?

@bruno-silva5
Copy link
Author

@andrewtpoe Unfortunately not yet. Some months ago was working fine. I ask myself what could caused this problem.

@alexanchek
Copy link

alexanchek commented Nov 3, 2022

I got the same issue using serve as the http server. But everything is ok with http-server (I mean using http-server instead of serve)

@komxvl
Copy link

komxvl commented Nov 22, 2022

Hi. Does anybody have some updates?

@Satsuger
Copy link

Having same issue

@Satsuger
Copy link

Indeed HTTP-server over npm serve package helps to fix this issue

@HakanSungur
Copy link

Same problem for me.

@itokun99
Copy link

Same issue when I was upgrade react v18. any solution guys? stuck here, I was tryin to code split using React.lazy and loadable component but nothing.

I've been migrate static generators https://vite-react-ssg.netlify.app/docs/Getting-Started but still lot's of work. it's not simply moving file like change by package json and script. It's change the source web (or migrating all of the app)

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

7 participants