-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Warning: Prop href
did not match. Server: "https://dev-user.example.com/" Client: "/"
#22130
Comments
I think this bug could reveal that The server is doing work that then React have to re-do in the frontend. Also I have to say this is super annoying while developing 😅 |
If you do this: <Link href="/">
<a href="/">Just a link</a>
</Link> You can avoid the issue. But I guess that's not the ideal way of using Link right? |
+1 experiencing same issue. Following. |
+1 experiencing same issue. After updated from 10.0.3 -> 10.0.9, all link get wrong domain, im not sure why it get the domain i set in domains instead of localhost:3000,
|
This seems related to #19922 |
I am experiencing the same issue after adding Below is the error I receive. Note that I am developing on
Next version: 10.0.8 |
Guys, I had the same issue: Warning: Prop |
This worked for me!! Thanks man! |
No luck for me still… it doesn't seem to be the slash. |
@djfarly I can confirm the same. process.env does not have all the data all the time. The result is that the SSG content does not have |
@vbuch oh wow - ty! I was starting to question my sanity :D |
@djfarly just a note: I still think it's a problem with our setup and not with next. Just... really hard to find so far. |
You're problably right. I got stuck asking myself why and how a process variable that is never directly metioned in code otherwise (as far is my search went) could have a different value at runtime than was defined via webpack define plugin. |
I solved this part of my problem. It doesn't solve the lack of |
Yes you're right, thx! Turns out it CANNOT be: If the path involves parent directory, you write: |
Interestingly, that issue says it is happening in 10.0.3, but downgrading to 10.0.3 fixes the issue for me. However, my use case looks like this:
|
I'm having the same problem here, anyone with some solution or any workaround? |
I have the same issue with nextjs 11.1.2. |
same issue, Oct 5th, 2021 |
Same here. Maybe this is related with react-i18next somehow? |
+1 having the same issue, the error is: Prop |
Confirming as well. For additional context, this is with absolute links and not relative links. This happens when we turn an experiment on and off. In that case, server will have the most of up to date href, while client has something different (the previous one).
cc @timneutkens |
Please open a new issue with a reproduction (following the issue template) and we'll have a look 👍 |
Same issue... NextJS 12.0.7 Any solution? |
What version of Next.js are you using?
10.0.7-canary.8
What version of Node.js are you using?
12.16.3
What browser are you using?
Google Chrome Version 88.0.4324.146 (Official Build) (x86_64)
What operating system are you using?
Mac OS Big Sur 11.1
How are you deploying your application?
next start
Describe the Bug
With this
next.config.js
And this code:
In
development
I'm watching these warings from React:Note that the domain is not
example
but I'm not onlocalhost
Expected Behavior
The expected behaviour is not having those warnigs. I think what React is trying to say is that the HTML generated by the server is different when is computed in the client.
If I switch my
next.config.js
from Next i18n Domain routing to Next i18n Sub-path routing these warnings are gone.So my theory is that
next/link
is behaving differently inServer
andClient
somehow.To Reproduce
Yes! I can reproduce. Here are the steps:
docker-compose up
/etc/hosts
My
/etc/hosts
has this line:After that you should see this error:
I think followed all the steps : ) Let me know if something is not clear.
The text was updated successfully, but these errors were encountered: