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
I've pages with URLs like /how-it-works/[id] which use getStaticProps and getStaticPaths. The problem occurs when I navigate to a similar route with different id. The data (from getStaticProps) is not updated. It remains as the data from the first time this route was accessed. If I refresh the page, the data gets updated but then the error occurs again when I try to navigate using links.
I'm accessing the data based on id through ctx.params in getStaticPaths.
The problem only started after upgrading to NextJS 11. This was working fine before.
I'm using next/link for navigating.
Expected Behavior
The data should get updated based on id when navigating using next/link.
To Reproduce
Create a dynamic route page like /how-it-works/[id]
Add getStaticPaths and getStaticProps to this page with data fetching based on id in getStaticProps.
Add some next/link Links to routes with different ids.
Try navigating using those links.
Error occurs.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 27, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.17.1
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
I've pages with URLs like
/how-it-works/[id]
which usegetStaticProps
andgetStaticPaths
. The problem occurs when I navigate to a similar route with differentid
. The data (fromgetStaticProps
) is not updated. It remains as the data from the first time this route was accessed. If I refresh the page, the data gets updated but then the error occurs again when I try to navigate using links.I'm accessing the data based on
id
throughctx.params
ingetStaticPaths
.The problem only started after upgrading to NextJS 11. This was working fine before.
I'm using
next/link
for navigating.Expected Behavior
The data should get updated based on
id
when navigating usingnext/link
.To Reproduce
/how-it-works/[id]
getStaticPaths
andgetStaticProps
to this page with data fetching based onid
ingetStaticProps
.next/link
Links to routes with differentid
s.The text was updated successfully, but these errors were encountered: