Repository navigation
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
hi-ogawa
left a comment
There was a problem hiding this comment.
One change beyond the backport: the bindings are resolved inside the jsdom copy the environment imported (
dirname(require.resolve('jsdom/package.json'))). A barejsdom/lib/generated/idl/utils.jsthat doesn't exist in that copy (jsdom < 28.1) makes Node fall through to a different jsdom higher innode_modules, and that copy'simplForWrapperreturns null for these wrappers. This repo hits it: v4 tests run on jsdom 27.4 while 29.1.1 is hoisted at the root.mainuses the same bare-subpath lookup; I haven't reproduced it there yet, but can send that fix separately.
Can you try reproduce that on main? main and v4 should have the same fix if we'd backport.
Backports vitest-dev#11295 and vitest-dev#11379. On jsdom 28+ the Blob impl stores its bytes as `_bytes`, so every Blob passed through `URL.createObjectURL`, a `Request` body or `FormData` became the string "undefined". jsdom 30.1 also stopped exposing the impl as an own Symbol, so the lookup itself threw. It also resolves jsdom's bindings inside the copy the environment imported. A bare `jsdom/lib/...` subpath is resolved from Vitest's own location and through NODE_PATH, which pnpm points at its store, so it can land in a different jsdom whose `implForWrapper` returns null for these wrappers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ef5ef7b to
f19f9b4
Compare
|
Written by an AI agent operated by @rifflock, who has reviewed it. Yes —
Repro on
The four are One caveat on which installs hit it: The same change on top of |
|
I'm re-running tests to make sure we're all good. Let me know if you want that PR to main, or if there's anything else I can do to be helpful. |
pls |
|
Hello @rifflock. Thank you for taking the time to contribute! Unfortunately, the team accepts pull requests only from maintainers and approved contributors, so this pull request was closed automatically. We are sorry about that, it is not a judgement of your work. The number of pull requests grew beyond what the team can review, and this policy gives maintainers the space to triage and prioritize issues at their own pace. If there is no issue for this change yet, please open one to discuss it with the team first. Your changes are not lost: a maintainer can reopen this pull request if the team decides to go forward with it. See our pull request policy for more context. |
|
Written by an AI agent operated by @rifflock, who has reviewed it. The same change on top of I haven't opened it as a PR because this one was closed automatically today, and a new PR from me would be closed the same way: I'm not on |
Description
Written by an AI agent operated by @rifflock, who has reviewed it.
Refs #11336
Backports #11295 and #11379 to
v4.On Vitest 4 with jsdom 28+, any Blob or File that goes through
URL.createObjectURL, aRequestbody orFormDatareads back as the string"undefined", because jsdom 28 renamed_bufferto_bytes. Tests that check upload contents still pass, because they compare against the wrong value. jsdom 30.1 also stopped storing the impl under an ownSymbol(impl), so the lookup throwsCannot read properties of undefined (reading '_buffer')(#11336).One change beyond the backport: the bindings are resolved inside the jsdom copy the environment imported (
dirname(require.resolve('jsdom/package.json'))). A barejsdom/lib/...subpath is resolved from Vitest's own location and throughNODE_PATH, which pnpm points at its store, so it can land in a different jsdom whoseimplForWrapperreturns null for these wrappers. This repo hits it: v4 tests run on jsdom 27.4 while 29.1.1 is hoisted at the root.mainhas the same bug. The reproduction is in the comments below, and the same change on top ofmainis onrifflock:fix/jsdom-bindings-resolution.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.test/core/test/environments/jsdom.spec.tswas run against jsdom 27.4.0, 28.1.0, 30.0.1 and 30.1.1. With the patch all 72 tests pass on every version. Without it, 28.1.0 and 30.0.1 fail the two new byte-level tests (6 failures) and 30.1.1 fails 12.pnpm lintandpnpm typecheckpass. The fullpnpm test:ciwas not run.Documentation
pnpm run docscommand.No new functionality.
Changesets
feat:,fix:,perf:,docs:, orchore:.🤖 Generated with Claude Code