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

Dynamic routing not working #426

Closed
adascal opened this issue Jul 26, 2019 · 2 comments · Fixed by #427
Closed

Dynamic routing not working #426

adascal opened this issue Jul 26, 2019 · 2 comments · Fixed by #427

Comments

@adascal
Copy link

adascal commented Jul 26, 2019

Describe the bug

I have the following pages structure:

pages
  post
    [id].js
  index.js

This should work according to the docs:
https://nextjs.org/learn/basics/clean-urls-with-dynamic-routing/dynamic-routing

The router seems to redirect correctly, however I get the following url on client-side transformed from http://localhost:3000/post/5 to http://localhost:3000/post/[id]?id=%5Bid%5D

Occurs in next-i18next version

#0.52.0

Steps to reproduce

Checkout example: https://github.com/adascal/next-i18next/tree/dynamic-routing-issue-example
master...adascal:dynamic-routing-issue-example

Expected behaviour

Routes are not transformed

Additional context

PR with fix (closed): #422
Similar issue: vercel/next.js#8092

@isaachinman
Copy link
Contributor

Hey @adascal - thanks for opening an issue. Your diagnosis of the problem is correct, but I've realised we need to hook into initializedLanguageOnce and set the asPath a little differently. I'll have a fix in for this within an hour or two.

@isaachinman
Copy link
Contributor

Note that we still have the problem with Link components as described in #413.

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

Successfully merging a pull request may close this issue.

2 participants