next/router fails to fetch data (getServerSideProps) when dynamic route contains an @ (at) symbol #39271
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Safari 15.6 (17613.3.9.1.5), Chrome 104.0.5112.79 (Official Build) (arm64)
How are you deploying your application? (if relevant)
next start, Vercel
Describe the Bug
When using
router.replace(router.asPath)
to "reload" a page, data fetching/getServerSideProps
isn't called for a dynamic route containing an@
(at symbol) and in production.In development, it works.
If the dynamic route doesn't contain an
@
, it works.If the route isn't dynamic (and instead in a file like
@foo.tsx
), it works.<12.1.7-canary.36 works (aka bug was introduced in =12.1.7-canary.36).
Expected Behavior
data fetching/
getServerSideProps
should still be called. In all other cases, it continues to be called, just not this very specific case.Link to reproduction
https://codesandbox.io/s/router-at-0vx48i-0vx48i?file=/pages/%5Bslug%5D.tsx
To Reproduce
The above code sandbox is deployed at https://csb-0vx48i.vercel.app/@slug
pages/[slug].js
:next build
;next start
The text was updated successfully, but these errors were encountered: