Repository navigation
React Native 0.87 debugger fixes and local build tooling - #2
Merged
teoboetti merged 6 commits intoSep 28, 2026
Merged
Conversation
Net.Server.listen() is asynchronous, so address() could still return null when DebugAdapterServer was constructed, producing a debug session pointed at an invalid port. Resolve the descriptor from the listen callback instead, and surface bind failures through reject.
React Native's @react-native/dev-middleware validates the Origin header on /inspector/debug WebSocket upgrades and closes connections whose origin is neither the dev server nor a loopback host. The proxy connected without one, so Metro answered 401 and logged: Connection from DevTools failed to be established for origin 'undefined' Build the application transport explicitly so the Origin header derived from the inspector URL is sent, and update the CDP proxy test for the new transport creation path.
A launch installs and starts the app, which finishes evaluating its bundle well before the CDP proxy manages to attach. Hermes replays scriptParsed on Debugger.enable, so breakpoints registered for that first run resolve and look bound, but the code they belong to has already executed and they are never reached. Reloading by hand makes them work, which is what users hit today. Hermes has no pause-on-load to wait for: it answers Runtime.runIfWaitingForDebugger with "Unsupported method" (-32601), so the only lever is to run the bundle again once the debugger is ready. Send a single Page.reload after the debugger goes quiet following its initial breakpoint requests. Reloads are driven by the device (the nativePageReloads capability), so the debugger stays attached and the breakpoints re-bind. The request is sent out of band with an id the debugger never issued, so it discards the reply as an unknown response id.
The lockfile pinned 220 tarballs to internal Azure Artifacts feeds and to registry.npmmirror.com. npm refuses those as "remote" type packages (EALLOWREMOTE), so npm install fails outside Microsoft's network. Both hosts mirror the public registry at the same paths, so the integrity hashes are unchanged. Drop this commit before opening a pull request upstream.
Keeps the sideloaded build ahead of the published 1.14.1 so the marketplace does not replace it on auto-update. Drop this commit before opening a pull request upstream.
Packages the extension on a v* tag and attaches the VSIX to that release, so it can be installed on a machine without the build toolchain. Also runnable on demand via workflow_dispatch, which just uploads the artifact. npm run install-local packages and installs into Codium in one step for the local edit loop. Drop this commit before opening a pull request upstream.
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.
Everything needed to debug React Native 0.87 from Codium, plus the tooling to build and install it. This is the branch the local VSIX is built from.
Debugger fixes
Wait for the debug adapter server to bind before reading its port —
Net.Server.listen()is asynchronous, soaddress()could still return null whenDebugAdapterServerwas constructed, pointing the session at an invalid port.Set the expected Origin header when connecting to the Metro inspector —
@react-native/dev-middlewarevalidatesOriginon/inspector/debugupgrades and answers 401 otherwise, so the CDP proxy never attached at all:Both of these mirror upstream PR microsoft#2782 by @urbanst, with two changes needed to actually compile here:
import WebSocket = require("ws")instead ofimport * as(this repo has noesModuleInterop), and a cast atnew WebSocketTransport(webSocket as any)becausevscode-cdp-proxyresolves its own nested copy of@types/ws.Reload the application once so first-run breakpoints are hit — the app finishes evaluating its bundle before the proxy attaches, so first-run breakpoints resolve but never fire. Hermes has no pause-on-load to wait for (
Runtime.runIfWaitingForDebugger→-32601 Unsupported method), soHermesCDPMessageHandlersends a singlePage.reloadonce the debugger goes quiet after its initial breakpoint requests. Covered by 5 unit tests.Local-only commits
Not for upstream — drop before any PR to
microsoft/vscode-react-native:registry.npmmirror.com, which npm rejects as remote packages (EALLOWREMOTE), sonpm installfailed outside Microsoft's network. Same mirrors, integrity hashes unchanged.v*tag and attaches the VSIX to the release;npm run install-localpackages and installs into Codium in one step.Validation
tsc --noEmitclean,gulp lintreports no new warningsnpm test— 465 passing, 0 failing (runnpx gulpfirst, orcommandsRegisteredfails on a missingdist/rn-extension)