fix(devtools): correct V8 stack regex when source path contains spaces#3531
Open
Copilot wants to merge 1 commit into
Open
fix(devtools): correct V8 stack regex when source path contains spaces#3531Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Fixes the greedy regex `/.+ (.+) .+/` which would incorrectly capture text when the caller's source path contains a space (e.g. webpack namespaces like `webpack://my app/...` or Windows paths under `C:\Program Files\...`). Replace with `/^at (.+?) \(/` which anchors at `at `, uses a lazy quantifier, and stops at the first ` (` — the boundary between the function name and the source location in a V8 stack frame. Adds deterministic regression tests for: - webpack namespace with a space in the path - Windows path with a space in the path - space-free path (regression guard) Closes #3530
Copilot created this pull request from a session on behalf of
dai-shi
June 22, 2026 06:32
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Size Change: +2 B (+0.02%) Total Size: 13.1 kB 📦 View Changed
ℹ️ View Unchanged
|
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.
Related Bug Reports or Discussions
Summary
The V8 stack frame regex
/.+ (.+) .+/used greedy matching, causing it to capture part of the source path instead of the function name whenever the path contained a space. This corrupted the action label shown in Redux DevTools — purely cosmetic, but consistently wrong.Affected patterns:
at Object.increment (webpack://my app/./src/store.js:10:5)→ was"(webpack://my", should be"Object.increment"at increment (C:\Program Files\app\store.js:10:5)→ was"(C:\Program", should be"increment"Fix — anchor to
at, use a lazy quantifier, stop at(:Adds three parameterized regression tests covering the webpack-namespace case, the Windows-path case, and a space-free path guard.
Check List
pnpm run fixfor formatting and linting code and docs