Minified React Error #418, #185, #130 and #423: What They Mean and How to Decode Them
React error 418 is a hydration mismatch, 185 is maximum update depth, 130 is an invalid element type, 423 is hydration recovery. How to decode and fix them.
"Minified React error #N" is React's production build telling you which error happened by number instead of by full text, to keep the bundle small. You decode it at https://react.dev/errors/N. The four you're most likely searching for: #418 is a hydration mismatch (server HTML didn't match the first client render), #185 is "Maximum update depth exceeded" (an infinite setState loop), #130 is "Element type is invalid" (you rendered something that isn't a component, usually a bad import), and #423 means React hit a hydration error and fell back to rendering the whole page on the client.
Why React shows numbers in production
React's development build ships with full error messages and extra warnings. The production build strips those strings out and replaces each one with a code. When an error is thrown, you see something like:
Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]=HTML&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
That URL is the decoder. The args[] parameters are the parts of the message that vary (a component name, a type), and the page fills them into the template for you. Open the exact URL from your console, not just /errors/418, so you get the filled-in version.
(Older React versions linked to reactjs.org/docs/error-decoder.html instead. The idea is the same.)
The common codes
The messages below are from React's own error code list, which is what react.dev/errors reads from. Some wording changed between React 18 and 19; the number stays the same.
#418: hydration failed
React 19 text: "Hydration failed because the server rendered %s didn't match the client. As a result this tree will be regenerated on the client." In React 18 it read "Hydration failed because the initial UI does not match what was rendered on the server."
Hydration is React attaching to HTML that a server already rendered (Next.js, Remix, Astro islands, any SSR setup). If the first client render produces different output, React gives up on that part and re-renders it. The React message itself lists the usual causes:
- A branch on
typeof window !== 'undefined' Date.now(),Math.random()or similar values that differ per call- Dates formatted in the user's locale, which differs from the server's
- Data that changed between the server render and the client render
- Invalid HTML nesting, like a
<div>inside a<p> - Browser extensions editing the page before React loads
Fix it by making the first client render match the server: move browser-only values into a useEffect, pass the server's data down instead of refetching, and fix nesting. The full walkthrough with code for each cause is in Next.js hydration errors.
A quick test for the browser-extension case: open the page in a private window with extensions disabled. If #418 goes away, your code is probably fine.
#423: recovered by client rendering the root
React 19 text: "There was an error while hydrating but React was able to recover by instead client rendering the entire root." React 18 phrased it as an error that happened "outside of a Suspense boundary", so "the entire root will switch to client rendering."
You rarely see #423 alone. It's usually reported next to #418 (or #425, "Text content does not match server-rendered HTML", in React 18). It tells you the consequence: React threw away the server HTML for the whole app and rendered from scratch in the browser. The page still works, but you lose the benefit of server rendering and may see a flash. Fix the underlying #418 and #423 goes with it.
If you wrap parts of your tree in <Suspense>, a mismatch inside one boundary only re-renders that boundary (code #422) instead of the whole root.
#185: maximum update depth exceeded
Text: "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
Something updates state, which re-renders, which updates state again, forever. In function components the usual culprit is an effect:
// Loops: runs after every render and always sets new state
useEffect(() => {
setItems([...items]);
});
Common patterns:
useEffectwith no dependency array that calls a setter.- An object or array in the dependency list that's recreated every render, so the effect always "changes".
- A child calling a parent's setter on every render, for example in a ref callback or during render.
Give effects a dependency array with stable values, and only set state when the value actually differs. The related error "Too many re-renders" is a separate code (#301) with similar causes; both are covered in React "Too Many Re-renders".
#130: element type is invalid
Text: "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s."
You wrote <Something /> and Something wasn't a component. Very often it's undefined, because the import doesn't match the export:
// Button.jsx
export function Button() { /* ... */ }
// App.jsx
import Button from "./Button"; // wrong: there is no default export
import { Button } from "./Button"; // right
Other causes:
- The component file doesn't export it at all.
- You imported from the wrong path or the wrong package entry point.
- A circular import means the value is still
undefinedwhen it's used. - You're rendering an object, such as a whole module (
import * as Icons) instead ofIcons.Star.
The decoded message fills %s with what React actually got, such as undefined or object. In development React also names the parent component ("Check the render method of ...") and adds a hint about mixing up default and named imports, which is the answer most of the time.
How to get the full, unminified message
The decoder gives you the text, but not the component stack or the extra warnings. To get those:
- Reproduce it in development. Run your dev server (
npm run dev,next dev,vite) and trigger the same page. The development build prints the full error, often with the component name and, for hydration errors, a diff of server vs client output. - Turn on source maps for production if it only happens there. They map the minified stack trace back to your files. In Vite that's
build.sourcemap; Next.js hasproductionBrowserSourceMaps. Source maps make your source readable to anyone who loads them, so upload them to your error tracker rather than serving them publicly if that matters to you. - Use an error tracker that captures the full URL with
args[]and the user's browser. Hydration errors in particular can depend on locale, time zone or extensions. (Error monitoring for beginners.)
Other codes you may see
A few that come up often, from the same list:
| Code | Meaning |
|---|---|
| #31 | Objects are not valid as a React child (fix) |
| #301 | Too many re-renders |
| #321 | Invalid hook call (rules of hooks, or two copies of React) |
| #422 | Hydration error inside a Suspense boundary, recovered by client rendering that boundary |
| #425 | Text content does not match server-rendered HTML (React 18) |
For any other number, react.dev/errors/<number> is the authoritative answer. A general approach to reading stack traces is in How to Read an Error Message.
EasySpawn gives every workspace a live URL, so you can reproduce a production-only React error on a real deployment and debug it in the same environment. See how it works or join the waitlist.
Related: Next.js Hydration Errors: What They Mean and How to Fix Them · React "Too Many Re-renders" and "Maximum Update Depth Exceeded": Fixes · Error Monitoring for Beginners: Find Out About Bugs Before Your Users Tell You · "Objects Are Not Valid as a React Child": How to Fix It
Keep reading
Unexpected End of JSON Input: Causes and Fixes
"SyntaxError: Unexpected end of JSON input" means you tried to parse JSON from an empty or cut-off string — most often calling response.json() on an empty response like a 204 or an error. How to find the real response, handle empty bodies safely, and fix the server side.
ReferenceError: X Is Not Defined — What It Means and How to Fix It
"Uncaught ReferenceError: x is not defined" means JavaScript can't find a variable or function with that name in the current scope. The common causes — typos, missing imports, scope, script load order, $ and jQuery, require in the browser, and window or document in server code — with a fix for each.