SocialGouv / code-du-travail-numerique

Code du Travail Numérique
https://code.travail.gouv.fr
Apache License 2.0
107 stars 22 forks source link

Minified React error #418 #6282

Open m-maillot opened 1 day ago

m-maillot commented 1 day ago

On a des erreurs minified : Minified React error #418; visit https://react.dev/errors/418

Voici la liste dans la dernière release : https://sentry.fabrique.social.gouv.fr/organizations/incubateur/issues/?environment=production&query=is%3Aunresolved+release%3Av4.162.0+%23418&referrer=issue-list&sort=freq&statsPeriod=24h

m-maillot commented 1 day ago

Voici ce que la doc React dit à propos de l'erreur :

Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.

It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.

https://react.dev/link/hydration-mismatch[missing argument]
m-maillot commented 1 day ago

J'ai tenté de voir ce que dit la stacktrace mais l'erreur se situe dans le package react-dom :

{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 198,
  column: 0,
  name: 'memoizedState'
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 253,
  column: 199,
  name: 'a'
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 264,
  column: 299,
  name: null
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 264,
  column: 299,
  name: 'Xk'
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 264,
  column: 321,
  name: 'al'
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 280,
  column: 257,
  name: 'Jd'
}
{
  source: '../../node_modules/next/dist/compiled/react-dom/cjs/react-dom.production.min.js',
  line: 70,
  column: 380,
  name: 'Error'
}