react
React Production Error Codes
Minified error codes emitted by React in production builds. When React detects a problem in production, it throws a numbered error and links to react.dev/errors/<code> for the full message.
10 codes
references react.dev/errorsgithub.com/facebook/react/blob/main/packages/shared/ReactErrorMessages.js
· All codes 10 codes
- 31 Objects Are Not Valid As A React Child A plain JavaScript object (or array, Date, etc.) was passed directly as JSX children. React can only render strings, numbers, booleans, null, undefined, or React elements. Call .toString(), JSON.stringify(), or map the array to JSX elements before rendering.
- 130 Invalid Element Type Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got an unexpected value. Often caused by a missing or incorrect import, or exporting a component as a default when a named export is expected.
- 185 Maximum Update Depth Exceeded Maximum update depth exceeded. This happens when a component calls setState inside componentWillUpdate or componentDidUpdate, causing React to re-render endlessly. Check that your lifecycle methods or effect hooks do not unconditionally trigger state updates.
- 301 Too Many Re-renders Too many re-renders. React limits the number of renders to prevent an infinite loop. This is usually caused by an unconditional setState call inside the render function or a useEffect/useMemo with a dependency that changes on every render.
- 418 Hydration Mismatch Hydration failed because the initial UI does not match what was rendered on the server. The client-side React tree must produce the same HTML structure as the server rendered output; any difference causes React to abandon hydration and fall back to a full client render.
- 419 Suspense Boundary Server Error The server could not finish this Suspense boundary, likely due to an error during server rendering. React will switch to client-side rendering for this boundary.
- 421 Suspense Boundary Update Before Hydration This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. To fix this, wrap the initial state update that triggers the Suspense boundary in startTransition.
- 422 Suspense Boundary Hydration Error There was an error while hydrating this Suspense boundary. Switched to client rendering. The error occurred inside a Suspense boundary so only that subtree will be re-rendered on the client.
- 423 Root Hydration Error There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch over to client rendering.
- 425 Text Content Mismatch Text content does not match server-rendered HTML. The text rendered by React on the client differs from what the server sent. Common causes include date/time values, random numbers, or other content that differs between server and client environments.