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

Mismatch server/client error when using Next trailingSlash and Link #248

Closed
equinusocio opened this issue Sep 2, 2020 · 3 comments · Fixed by #252 or #285
Closed

Mismatch server/client error when using Next trailingSlash and Link #248

equinusocio opened this issue Sep 2, 2020 · 3 comments · Fixed by #252 or #285

Comments

@equinusocio
Copy link

equinusocio commented Sep 2, 2020

I get a console error when i set trailingSlash: true inside the next config and using next-translate <Link>. With that setting, when I set a link like this:

<Link href="/saving">
    <a>{t('common:pages.saving')}</a>
</Link>

I get:

Warning: Prop `href` did not match. Server: "/saving" Client: "/saving/"
    in a (at header.tsx:60)
    in Link (created by Link)

Even adding the final / inside the href i get the same error. Here my i18n.json setting:

  "allLanguages": ["en", "it"],
  "defaultLanguage": "it",
  "defaultLangRedirect": "root",
  "currentPagesDir": "pages_",
  "finalPagesDir": "pages",
  "localesPath": "locales",
  "pages": {
    "*": [
      "common"
    ]
  }
}
@aralroca aralroca mentioned this issue Sep 16, 2020
@aralroca
Copy link
Owner

I'm going to put now this fix under the 0.17.3-canary.1 prerelease. It will be released on 0.17.3 soon

@equinusocio
Copy link
Author

equinusocio commented Sep 29, 2020

@aralroca I still have this issue even with 0.17.3-canary.3. My configuration:

{
  "allLanguages": ["en", "it"],
  "defaultLanguage": "it",
  "currentPagesDir": "pages_",
  "finalPagesDir": "pages",
  "localesPath": "locales",
  "pages": {
    "*": [
      "common"
    ]
  }
}

@aralroca aralroca reopened this Sep 29, 2020
@giovannigiordano
Copy link
Contributor

It seems to be an issue related to nextjs. I tried downgrading it to 9.4.0 and it works, so it needs more investigation.

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