Pages duplicate when accessing with /index.html
See original GitHub issueVersions:
“preact-cli”: “^3.4.1”, (standard template) “preact”: “^10.11.3”, “preact-render-to-string”: “^5.1.4”, “preact-router”: “^4.1.0”
I’m not sure if this is a bug or wheter it’s by design. It seems an issue for use cases.
I set up the routing like this:
<Header />
<Router>
<Home path="/" />
<Component2 path="/component2" />
<Component3 path="/component3 />
</Router />
<Footer />
The issue: When pages are accessed with index.html
, i.e. mysite.com/index.html, the site is duplicated as soon as one navigates to a new route. Inspecting the DOM shows that both elements are present. The previous page is attached after the new one.
This can be an issue since some Projects used /index.html as entry point and many backlinks point to /index.html.
I did a rather dirty workaround to hide the duplicate element from the viewer. The issue can be solved that way, but it’s far from a elegant solution.
I’m aware that the issue could also be solved by re-directing in the backend. But that’s not elegent either.
How you guys deal with that issue?
Issue Analytics
- State:
- Created 9 months ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
No worries, and if you are able to reproduce I’d be happy to reopen and investigate.
Sorry that’s happening for you though, not really sure what that could be. Browser cache? Old service worker perhaps?
I can’t reproduce the behaviour as well when trying to build it with a new set up. Probably there is something corrupted in my project. I think this issue can be closed. Sorry for false alarm.