You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My situation is a little bit complicated and I will try my best to tell a clear story.
Simple description
The content of the statically generated index page is showing up on every dynamic client-side rendered route.
Detailed story
I have a dynamic route, e.g., '/:user/:project', and all other pages, including the index page, are statically generated during building for SEO purposes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My situation is a little bit complicated and I will try my best to tell a clear story.
Simple description
The content of the statically generated index page is showing up on every dynamic client-side rendered route.
Detailed story
I have a dynamic route, e.g., '/:user/:project', and all other pages, including the index page, are statically generated during building for SEO purposes.
My
react-router.config.ts
:and my
app/routes.ts
:In my
app/routes/home.tsx
, I simply have:And my
app/routes/project.tsx
displays the route parameters:The
nginx.conf
:Expected behavior
When I visit
example.com
, I can see "Homepage" on the screen.And when I visit
example.com/user1/project2
, I see "user1/project2".Actually behavior:
When I visit
example.com/user1/project1
, the actual result is:"
Homepage
user1/project1
"
The content of the statically generated index page, "Homepage", shows up on every dynamical route.
Other information
npm run dev
works perfectly fine; the issue arises only with the static build when deployed behind Nginx.Source code
https://github.com/batchor/react-router
Beta Was this translation helpful? Give feedback.
All reactions