Repository navigation
Conversation
This branch has not been deployed
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.
With
NODE_USE_ENV_PROXY=1, loading the request transport can make Node 22 RPC/provider calls bypass the environment proxy. A key-free local reproduction succeeds with built-infetchbefore importing current main's Undici 8.10.2, then fails withENOTFOUNDfor an origin reachable only through the proxy.Undici 8 initializes
undici.globalDispatcher.2with a plain Agent and replacesundici.globalDispatcher.1with its compatibility wrapper. Node 22's built-in fetch uses the latter, so its existing EnvHttpProxyAgent is lost. This also affects viem's default HTTP transport.Route the request transport's Undici imports through a small shim that captures the existing v1 dispatcher before initialization and restores it afterward. Explicit Undici request dispatchers and its v2 dispatcher remain independent. This preserves existing runtime proxy/custom-dispatcher configuration without changing the packaged Node version or TLS settings. The shim relies on Undici's shared dispatcher symbol; fresh-process tests cover that compatibility boundary.
Validation:
pnpm packagebuilds the request binary;--versionsmoke test passes. A loopback proxy harness loads the actual bundled CLI usingPKG_EXECPATH=PKG_INVOKE_NODEJS: RPC fetch retains the original dispatcher and succeeds under both the SHA-256-verified v0.11.0 release's Node 22.22.3 runtime and the newly built Node 22.23.2 runtime.Supplemental validation in the original cloud environment at exact PR commit
9cf4e0c8794af1202b67846bb77a019109dcaf44:EAI_AGAINafter that import. Loading the fixed request module preserves the existing dispatcher and the public RPC again returns chain ID 4217.tempo-request. An isolated empty-home dry-run against the public RPC returns chain ID 4217. A separate packaged fixed-module viem probe under Node 22.23.2 also returns chain ID 4217.sqlite3(spawn sqlite3 ENOENTand downstream session assertions); the cloud full suite is not green. The macOS and GitHub Linux CI suites above still pass all 302 tests.--require; direct packaged probes were used for that runtime.The automated loopback proxy fixture uses HTTP and a reserved
.invalidorigin; the supplemental public RPC probes cover the original cloud network path. No credentials or payment operations were used, and existing runtime wrappers were not changed.