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

Using i18n configuration throws "Warning: Prop href did not match" error #24442

Closed
marnixhoh opened this issue Apr 25, 2021 · 3 comments
Closed
Labels
bug Issue was opened via the bug report template.

Comments

@marnixhoh
Copy link

What version of Next.js are you using?

10.0.8

What version of Node.js are you using?

14.16.1

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Custom server for development

Describe the Bug

I am getting a Warning: Prop `href` did not match error after adding i18n / Internationalized Routing to my next.config.js file. Note, that without adding that, this error does not occur. The i18n section of my next.config.js file:

i18n: {
    locales: ['en-US', 'nl'],
    defaultLocale: 'en-US',

    domains: [{
        domain: 'localhost',
        defaultLocale: 'nl',
        locales: ['en-US']
    }]
}

Below is the error I receive. Note that I am developing on http://localhost, but for some reason next.js is forcing https on the server:

Warning: Prop `href` did not match. Server: "https://localhost/" Client: "/"

This error traces back to the href property set on the next/link Component.

Next version: 10.0.8

Expected Behavior

I expect this error to not occur...

To Reproduce

Adding the above i18n configuration to a next.js project.

@marnixhoh marnixhoh added the bug Issue was opened via the bug report template. label Apr 25, 2021
@marnixhoh
Copy link
Author

Note that I have added a summary of the above in a comment to #19922, since I believe these two issues might be related

@marnixhoh
Copy link
Author

Closing, because it is a duplicate of #22130

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants