Issues with Dynamic Route and initialCanonicalUrl Property #63839
Unanswered
cameronsb
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I have a project that uses a Dynamic Route in the App Router - for example,
/resource/edit/[id]/page.js
.There are 2 issues occurring, both of which seem to be related.
When the page is loaded, there is a failed request made to
mysite.com/resource/edit/123/null
.There's a sidebar with a "back" button (which is actually just updating the UI rather than navigating). When clicking the "back" button, there is always a request for
mysite.com/resource/edit/123/undefined
.Given the workflow of the app, these 404s clog up the console and make it seem like something is broken, but I'm not sure where the behavior is coming from.
After digging into the document, both of these values are defined internally by the
initialCanonicalUrl
property."initialCanonicalUrl: "/resource/edit/123/null/", ...
I've seen this property mentioned here:
#58357
However, it's not quite the same issue.
I can provide more details as needed, but I'm wondering if there's a way to troubleshoot/tweak the value that is ultimately used as the
initialCanonicalUrl
value, since I haven't found it anywhere in the docs.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions