This error means JavaScript tried to read a property (the word in quotes at the end) off a value that is undefined — the code expected an object and got nothing. It is the single most common runtime error in web development, and it is always the same detective story: which value was undefined, and why wasn't it there when the code ran?
(reading 'name') tells you the property being accessed — the code did something like user.name where user was undefined.console.log('user =', user) — then ask where that value was supposed to come from: an API response, a function argument, a lookup in an array, a piece of state.useState(null) + a guard), not a faster network.data.results when the response is data.items, or an error response where data was assumed. Log the actual response.arr.find(...) returns undefined when nothing matches; arr[0] on an empty array. Both flow silently into property access.return without a value on one branch, used as if it always returns an object.order.customer.address.city where any level can legitimately be absent.user?.name — evaluates to undefined instead of throwing. Pair it with a fallback for display: user?.name ?? 'Guest'.[] and objects as {} (or null + explicit loading UI) so first renders don't dereference nothing.?. everywhere stops the crash and keeps the bug. If the value was supposed to exist, optional chaining converts a loud error into silent missing data. Guard the spots where absence is normal; fix the spots where it isn't.
“Cannot read properties of null” is the same story with a different empty value — null usually means “deliberately set to nothing” (an initial state, a cleared field, a JSON null), while undefined means “never set at all.” Knowing which one you're holding often identifies the culprit immediately.
Why does it work sometimes and crash other times? Data timing or data shape: a slower network, an empty result set, one record missing a field. Intermittent versions of this error are data-dependent, so reproduce with the exact account/record that crashed.
Is this a browser bug? No — it's the language reporting an invalid operation, precisely as designed. The bug is always in the code's assumptions about its data.