Skip to content

fix: downgrade vitest to 3.x and jsdom to 25.x for ESM/CJS compat#463

Open
itaysel wants to merge 1 commit intostagingfrom
fix/vitest-esm-compat
Open

fix: downgrade vitest to 3.x and jsdom to 25.x for ESM/CJS compat#463
itaysel wants to merge 1 commit intostagingfrom
fix/vitest-esm-compat

Conversation

@itaysel
Copy link
Collaborator

@itaysel itaysel commented Feb 22, 2026

vitest 4.x pulls in vite 7.x (ESM-only) as a nested dependency, which breaks vitest's CJS config loader with ERR_REQUIRE_ESM on Node 22.

jsdom 27.x pulls in html-encoding-sniffer 6 -> @exodus/bytes (ESM-only), causing the same CJS require() failure in the jsdom test environment.

Pin vitest to ^3.2.4 (compatible with vite 5) and jsdom to ^25.0.1 (uses whatwg-encoding, CJS-compatible).

vitest 4.x pulls in vite 7.x (ESM-only) as a nested dependency, which
breaks vitest's CJS config loader with ERR_REQUIRE_ESM on Node 22.

jsdom 27.x pulls in html-encoding-sniffer 6 -> @exodus/bytes (ESM-only),
causing the same CJS require() failure in the jsdom test environment.

Pin vitest to ^3.2.4 (compatible with vite 5) and jsdom to ^25.0.1
(uses whatwg-encoding, CJS-compatible).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants