You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Node stack parser splits anonymous frames at ( inside the file path (C:\Program Files (x86)\..., My App (beta)/...) #26202
Run node index.js from a directory whose path contains a space followed by (. The same happens for any anonymous V8 frame such as at C:\Program Files (x86)\MyApp\index.js:2:9 or at async /home/me/My App (beta)/index.js:2:9.
at /home/me/My App (beta)/index.js:4:11
beta)/index.js | /home/me/My App 4 11
Parsing at C:\Program Files (x86)\MyApp\index.js:2:9 returns {"function":"C:\\Program Files","filename":"x86)\\MyApp\\index.js","in_app":false}. Named frames (at main (/home/me/My App (beta)/index.js:5:3)) are parsed as expected.
Additional Context
FULL_MATCH in packages/core/src/utils/node-stack-trace.ts is /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; the optional lazy (.+?)\s+\( function-name group matches up to the first ( in the path even when the line has no name ( prefix. The truncated filename no longer starts with / or a Windows drive letter, so filenameIsInApp also returns false, and source map lookup and code context fail for these frames. The browser chromeStackLineParser shows the same split for Node-style frames.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
FULL_MATCH in packages/core/src/utils/node-stack-trace.ts takes a lazy optional function group, (?:(.+?)\s+\()?, so an anonymous Node frame whose path contains ( is split at the first parenthesis. On current develop (6c6c0402), at C:\Program Files (x86)\MyApp\index.js:2:9 comes out as function C:\Program Files and filename x86)\MyApp\index.js with in_app false, and at async /home/me/My App (beta)/index.js:4:11 splits the same way. Named frames that already wrap the path in parentheses parse correctly.
The change I have in mind is one line: only take that function group when the frame actually ends with ) ((?=.*\)\s*$)). Anonymous frames then keep the full path and ? as the function, and the existing named, Object.<anonymous>, native, node:internal and eval at ... cases stay as they are. I would add the two anonymous cases above, plus a named frame with parentheses in the path, to the node block in stacktrace.test.ts.
The browser chromeStackLineParser mentioned in the issue would stay out of this change unless you want it in the same PR. Happy to open the PR against develop if this is useful. OK to go ahead?
(This comment was drafted with the help of an AI assistant, Claude.)
Activity
linear-code commentedon Nov 7, 2026
JS-4086
pcbeingused333 commentedon Nov 7, 2026
FULL_MATCHinpackages/core/src/utils/node-stack-trace.tstakes a lazy optional function group,(?:(.+?)\s+\()?, so an anonymous Node frame whose path contains(is split at the first parenthesis. On currentdevelop(6c6c0402),at C:\Program Files (x86)\MyApp\index.js:2:9comes out as functionC:\Program Filesand filenamex86)\MyApp\index.jswithin_appfalse, andat async /home/me/My App (beta)/index.js:4:11splits the same way. Named frames that already wrap the path in parentheses parse correctly.The change I have in mind is one line: only take that function group when the frame actually ends with
)((?=.*\)\s*$)). Anonymous frames then keep the full path and?as the function, and the existing named,Object.<anonymous>,native,node:internalandeval at ...cases stay as they are. I would add the two anonymous cases above, plus a named frame with parentheses in the path, to thenodeblock instacktrace.test.ts.The browser
chromeStackLineParsermentioned in the issue would stay out of this change unless you want it in the same PR. Happy to open the PR againstdevelopif this is useful. OK to go ahead?(This comment was drafted with the help of an AI assistant, Claude.)