component tier: unhandled rejection in vitest-browser-react render (ItemResellersPopover) — vitest warns it may cause false positives
Split out of PR #4218 review, where it appeared in a CI log alongside an unrelated failure. Not caused by that PR — it originates in a different file and predates the branch.
What vitest reports
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
TypeError: Cannot read properties of undefined (reading 'includes')
❯ Module.render node_modules/.vite/vitest/…/deps/vitest-browser-react.js:59:22
This error originated in "src/components/CreatorShop/Manage/ItemResellersPopover.browser.test.tsx" test file.
The latest test that might've caused the error is "an unportalled popover in the same table lands inside it".Why it is worth its own issue
Vitest's own warning is the point: "This might cause false positive tests." An unhandled rejection escaping vitest-browser-react's render is exactly the shape that can leave a suite reporting green for the wrong reason, and the component project is report-only — its failures do not gate — so nothing forces anyone to look at it.
Reproduction status — honest, and it matters
It is intermittent, and it correlates with load:
| run | box condition | unhandled rejection |
|---|---|---|
pr-preview-4218-7qz6p |
loaded — 80 tests >5s, slowest 68.8s, tests 940.9s |
present |
pr-preview-4218-4q768 |
quiet — 38 tests >5s, slowest 40.9s, tests 547.9s |
absent |
Same tree, same 174 files, same 1916/1917 tests. So a single local run proving "I can't reproduce it" is not evidence of absence — it needs either a loaded box or repeated runs.
Suggested starting point
vitest-browser-react's render reading .includes on something undefined smells like a cleanup/teardown race — a component still rendering after its container or a props array has been torn down. The named test (an unportalled popover in the same table lands inside it) does portal-boundary work, which is the kind of thing that keeps a node alive across an unmount. Worth checking whether that suite leaves a popover mounted between cases.
Not fixing it here — flagging it so it does not stay invisible behind a report-only tier.
Source: civitai/civitai