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

NextJS trailingSlash not supported #4

Open
christoph-pflueger opened this issue Nov 26, 2021 · 6 comments
Open

NextJS trailingSlash not supported #4

christoph-pflueger opened this issue Nov 26, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@christoph-pflueger
Copy link

NextJS has an option to configure trailing slashes in URLs: https://nextjs.org/docs/api-reference/next.config.js/trailing-slash

At the moment, this option causes mismatches between server and client.

@cvolant
Copy link
Collaborator

cvolant commented Dec 7, 2021

Hi @git-chrisp, I added the trailing slash option to the next.config.js in the repo example, and I don't experience any problem. Could you give more details, or better, a reproduction of the bug?

@christoph-pflueger
Copy link
Author

Reproduction: https://github.com/git-chrisp/next-translate-routes-nextjs-trailing-slash-bug

When visiting localhost:3000/de/ the following error is printed in the console:

next-dev.js?3515:32 Warning: Prop `href` did not match. Server: "/de/seite1" Client: "/de/seite1/"

@cvolant
Copy link
Collaborator

cvolant commented Dec 23, 2021

At first, I could not reproduce: I don't know why, but I did not get the warning on Firefox. I tried on Chromium - just in case - and I got it.
I added a fix in the next release.

@cvolant
Copy link
Collaborator

cvolant commented Jan 5, 2022

Done. Please reopen this if it is not fixed for you.

@cvolant cvolant closed this as completed Jan 5, 2022
@artemkhalygov
Copy link

@cvolant on next v13 I have the same problem.

@stovein
Copy link

stovein commented Mar 15, 2023

Hi, I also get this error too while having trailing slash option true in next.config.js
next-translate-routes: 1.9.1v
next: 12.3.4v

@cvolant cvolant reopened this Mar 16, 2023
@cvolant cvolant added the bug Something isn't working label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants