Missing route part on client side render
Unanswered
Ant posted this in #help-forum
AntOP
Hi all, Im struggling to recreate this, but have a serious problem in production :/
I have this Page:
I have a rewrite rule
And when loading each page in the browser directly, everything works fine.
But when using Next/Link for client side navigation everything falls appart with this log output:
Basically the domain is lost somewhere along the way, only when using client side routing...
Have anybody seen this before? :/
I have this Page:
src/app/[domain]/[[...route]]/page.tsx
I have a rewrite rule
rewrites: async () => {
return [
{
source: "/:path*",
destination: `/${process.env.DEMO_SITE}/:path*`,
},
]
And when loading each page in the browser directly, everything works fine.
But when using Next/Link for client side navigation everything falls appart with this log output:
{ domain: 'nodhjelp', route: undefined }
Basically the domain is lost somewhere along the way, only when using client side routing...
Have anybody seen this before? :/
3 Replies
AntOP
The Link is the missing link 😄 notice that when navigating to the page, the domain is changed from demo.example.com to the path "some-page"
https://next-bug-rewrite.vercel.app/
https://next-bug-rewrite.vercel.app/