AsPath is incorrect on Server if you use rewrites and getInitialProps #20370
Milestone
Comments
|
Im not sure if this is a duplicate as #17143 seems to be an issue with pages using static optimization / getStaticProps. |
|
I think same issue was used to happen on
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Bug report
Describe the bug
AsPath is incorrect on Server if you use rewrites and getInitialProps. On the server, asPath is the rewritten asPath while on the client asPath ist as given in the request URL.
To Reproduce
Start with a new next typescript project. And add:
Next.config.js
/pages/product/[pid].tsx
/s1/product/42Expected behavior
AsPath on server and client ist
/s1/product/42System information
Additional Information
If you use getServerSideProps instead of getInitialProps it works as expected. You can test this by replacing
with
The text was updated successfully, but these errors were encountered: