-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(core): Decode filename and module stack frame properties in Node stack parser
#14544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a4ee349 to
73eda05
Compare
timfish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
filename and module stack frame properties in Node stack parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the module name extraction logic was previously untested. Thought I'd add some general tests as well.
| const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.'); | ||
| return moduleName ? `${moduleName}:${decodedFile}` : decodedFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change also includes a tiny refactor to use a template string instead of concatenation. I made the change after writing the tests btw, so this should be fine
37d1091 to
681b591
Compare
size-limit report 📦
|
While working on #14525, I noticed that for some reason, I wasn't getting any context lines for the source JS file but instead a bunch of debug messages about the SDK not being able to read the file. The file path happened to contain spaces which were URL-encoded (
%20). It turns out that in ESM, the Node stack trace filenames are URL-encoded. I checked and this and it only seems to be the case in ESM, not in CJS.Specifically, this PR:
filenamestack frame propertymoduleproperty (which is derived from the raw filename)