Next.js Discord

Discord Forum

Server and client html don't matches but the content is the same in console.

Answered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Setting up my working repo and yesterday everything was great. Today got some errors about content, like the server and the client didnt match. Trying to find the solution all the day. The problem is not in repo or in plugins in chrome. Tried in different browsers and nothing changed.
Where i should try to find the reason of this error?
Answered by Cape lion
thank u guys! i already found a solution)
the problem was in numbers so i replace this regexp to Intl.NumberFormat and it helped
View full answer

16 Replies

@gin something is malformed in ur tsx
Cape lionOP
 
<span className="productPriceCurrentList">
                {price.toLocaleString().replace(/,/g, ' ') + '₽'}
              </span>

suppose its somewhere here..

the component is quite big.. i can send u a file in dm if u dont mind to)
@gin u should never call a function inside tsx
Cape lionOP
its not mine code)
is that component serverside
so no "use client"
Cape lionOP
it works well for other devs in my team
so i think it smt wrong just with my pc
try using a different element
maybe <a>
sometimes thats also the issue
Cape lionOP
thank u guys! i already found a solution)
the problem was in numbers so i replace this regexp to Intl.NumberFormat and it helped
Answer
Glad it worked