This is a reference entry from React error codes. A full explanation with fixes has not been written yet.
The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.
%s is filled in by React at runtime.
- Category
- Minified React error
- Severity
- error
- Runtime
- both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: React error codes. Data fetched 2026-09-25T01:43:12.927Z.