Conversation
robhogan
added this pull request to stack #1940
September 17, 2026 11:47
robhogan
force-pushed
the
pr1939
branch
2 times, most recently
from
September 29, 2026 17:29
a898e90 to
0fa7eff
Compare
robhogan
marked this pull request as ready for review
September 29, 2026 17:31
There was a problem hiding this comment.
Copilot review overview
馃煝 Approval recommended
The focused parser change correctly handles Windows drive prefixes and is covered by regression and existing directory-context tests.
Review effort: Balanced
Findings: None
What changed in this PR
Updates stack-frame parsing to support Windows drive-letter paths while preserving existing formats.
Changes:
- Accepts
X:\prefixes in stack-frame filenames. - Adds cross-platform regression coverage.
- Re-enables symbolication tests on Windows.
| File | Description |
|---|---|
scripts/鈥媕estFilter.js |
Removes the obsolete Windows test exclusion. |
packages/鈥媘etro-symbolicate/鈥媠rc/鈥婼ymbolication.js |
Extends stack-frame parsing for Windows paths. |
packages/鈥媘etro-symbolicate/鈥媠rc/鈥媉_tests__/鈥媠ymbolicate-test.js |
Tests Windows-prefixed stack frames. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary: `metro-symbolicate` parses stack frames with a regex that doesn't allow `:` in file names, so a frame with a Windows absolute path is misparsed at the drive letter: ``` someFunc@D:\app\foo.js:4:0 ``` is read as function `D`, file `\app\foo.js`. The match starts at the drive letter, so `someFunc@` is left in the output, and the file name loses its drive - which matters for directory contexts (`symbolicate <dir>`), where the file name is used to find the source map. This allows an optional `X:\` drive prefix on the function-name-or-file slot and the file slot. Posix paths, module IDs (`123.js`), Android (`bar:4:18063`, `bar:123.js:4:18063`) and `[native code]` frames parse exactly as before - the prefix requires a backslash, so e.g. a single-letter function before a posix path (`a:/js/foo.js:4:1`) is unaffected. Changelog: [Fix] Fix `metro-symbolicate` stack trace parsing of Windows absolute paths Test Plan: Adds a platform-independent test that symbolicates `testfile.stack` with `C:\app\` prefixed file names, and expects the same output as the original. Without this change it fails on all platforms: ``` - thrower.js:18:null + throws6@thrower.js:18:null - thrower.js:30:arguments + o@thrower.js:30:arguments ``` Removes `symbolicate-test.js` from the Windows skip list. Its directory context tests use real absolute paths, and previously failed on Windows CI with: ``` - /js/react-native-github/Libraries/BatchedBridge/BatchedBridge.js:23:Object + someFunc@/js/react-native-github/Libraries/BatchedBridge/BatchedBridge.js:23:Object - <testDir>/__fixtures__/directory/fileThatDoesntExist.js:10:null + fn@\a\metro\metro\packages\metro-symbolicate\src\__tests__\__fixtures__\directory\fileThatDoesntExist.js:10:null ``` ``` yarn jest packages/metro-symbolicate Tests: 76 passed, 76 total ```
vzaidman
self-requested a review
September 30, 2026 09:26
vzaidman
approved these changes
Sep 30, 2026
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.
metro-symbolicatedoesn't allow:in file names when parsing stack frames, so a Windows absolute path is split at the drive letter.someFunc@D:\app\foo.js:4:0is read as functionDin file\app\foo.js. The output then has a straysomeFunc@and a file name with no drive, which breaks finding the source map in directory mode.This accepts an optional
X:\drive prefix. The prefix requires a backslash, so posix paths, module IDs, Android frames and[native code]parse exactly as before.Changelog:
Test plan:
New test symbolicates the existing fixture with
C:\app\-prefixed file names and expects the same output as the original. Without this it fails on every platform:Also removes
symbolicate-test.jsfrom the Windows skip list.