fix: node-20-safe browser-host simulation in the Cache API test - #53
Merged
Conversation
undici on node 20 splits process.versions.node inside fetch(); deleting it crashed the test host. Swap the globalThis.process reference instead - only the registry's detection reads globalThis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #52: the Cache API test simulated a browser by deleting
process.versions.node - node 20's bundled undici does
versions.node.split() inside fetch(), so the test host itself crashed
(TypeError with no stack, passed on node 24). The simulation now swaps
the globalThis.process reference (only the registry's Node detection
reads globalThis; undici holds the real binding). Verified green on
node 20 and 24.