Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-side routing requests incorrect path with getServerSideProps on Vercel #83

Open
kodai3 opened this issue Jul 4, 2024 · 0 comments

Comments

@kodai3
Copy link

kodai3 commented Jul 4, 2024

What version of this package are you using?
^2.6.2
What operating system, Node.js, and npm version?
node: v20
What happened?
When using client-side routing with getServerSideProps with the plugin enabled, the client-side requests are being sent to /example instead of the expected /_next/data/[build-id]/example.json. This results in every request hitting the server directly.
Because I want to defer getServerSideProps on client side navigation regarding to this issue and workaround, this behavior slows down routings.

If you remove next-translate-plugin from next.config.js it works as expected with or without other plugins like next-pwa and @sentry/nextjs.

The reproduction is here.
You can't see the problem when you yarn dev, yarn start or even vercel dev, but only deployed to Vercel.
I haven't tested it with Cloud Run or similar services, so I don't know if they exhibit the same behavior other than Vercel.

What did you expect to happen?
I expected the client-side routing to send requests to /_next/data/[build-id]/example.json

Are you willing to submit a pull request to fix this bug?
I want, since it is affecting our production, but I will need some expertise as I am not very familiar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant