fix(browser): Fix parenthesis parsing logic for chromium#12373
Merged
fix(browser): Fix parenthesis parsing logic for chromium#12373
Conversation
2 tasks
c93fa86 to
1933b22
Compare
Contributor
size-limit report 📦
|
Collaborator
|
0.2% bundle increase which busted the size limit for |
dohooo
reviewed
Jun 5, 2024
| stack: `Error: bad | ||
| at something (http://localhost:5000/(some)/(thing)/index.html:20:16) | ||
| at http://localhost:5000/(group)/[route]/script.js:1:126 | ||
| at more (http://localhost:5000/(some)/(thing)/index.html:25:7)`, |
There was a problem hiding this comment.
Is this could be passed?
at (http://localhost:5000/(group)/[route]/script.js:1:126)
Contributor
Author
There was a problem hiding this comment.
I had the same thought but chrome doesn't emit such frames I think.
Collaborator
There was a problem hiding this comment.
We haven't seen stack lines like that. They only appear to be surrounded in parenthesis when there is filename.
mydea
reviewed
Jun 6, 2024
| } | ||
|
|
||
| // Chromium based browsers: Chrome, Brave, new Opera, new Edge | ||
| const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; |
Member
There was a problem hiding this comment.
could we add a comment here for what this would match, as an example? makes it easier to follow this than to try to parse the regex 😅
mydea
approved these changes
Jun 6, 2024
Lms24
approved these changes
Jun 6, 2024
|
nice @lforst when will it be released? |
Contributor
Author
|
soon™ |
Contributor
Thanks for mention! |
3 tasks
billyvg
pushed a commit
that referenced
this pull request
Jun 10, 2024
Co-authored-by: Tim Fish <tim@timfish.uk>
This was referenced Jul 3, 2024
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.
We had a bug where the chrome stack trace parser incorrectly parsed stack frames when the frame was not inside a function (ie. top level in a module) and contained parentheses.
This surfaced in Next.js because Next.js has file based routing with folders that can contain parentheses and our debug ID injection snippet is injected top-level.
We fix this by first using a regex that attempts to match a simple top level module frame, and if it matches we extract the filename and line/colnumbers without attempting to use the more elaborate regex.