Accessing dynamic routes when using static html export build #16339
Unanswered
jonasgroendahl
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I'm creating a client rendered app using nextjs and hosting it on AWS S3. When I access dynamic routes locally in development, say
/posts/1
, it works great! but when I build and run the build locally usingserve
, I can't access/posts/1
but however if I try to access/posts/[id]
, it does work.The idea is that a user may access
/posts/1
, then data is fetched inside my React component using a useEffect() with the route param, just like you would in a client rendered app using react-router and create-react-app.Hope someone can understand what I'm trying to achieve here. Is this possible or did I miss something?
Beta Was this translation helpful? Give feedback.
All reactions