Why is Dynamic Link Variable not interpolated on Link => getServerSideProps #14822
-
In the below example - if I hit the url directly On top of this - this only happens in the production build deployed to vercel - this behavior does not happen in development... something I'm doing wrong? Page: https://www.example.com/feed <Link href="/post/[slug]" as="/post/abc">
<a>First Post</a>
</Link> Page: https://www.example.com/post/[slug] export const getServerSideProps: GetServerSideProps = async (context) => {
const postData = await fetcher(`/api/${context.params.slug}`, context.req.headers);
return {
props: {
initialData: !!postData ? postData : null,
},
};
}; |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
For more context - here is straight from the Vercel deployed logs |
Beta Was this translation helpful? Give feedback.
-
Hey @followbl! Does this work as intended if you build/start locally? For me it does, but I just wanted to narrow it down a bit. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report! Had @ijjk look into this, here's the PR to fix it: vercel/vercel#4778 |
Beta Was this translation helpful? Give feedback.
Thanks for the report! Had @ijjk look into this, here's the PR to fix it: vercel/vercel#4778