-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nextjs): Do not strip origin information from different origin stack frames #15418
Conversation
72c5969
to
c38281a
Compare
size-limit report 📦
|
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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.
I think it would be good to use this option in an E2E test to test it.
const { origin } = new URL(frame.filename as string); | ||
frame.filename = frame.filename?.replace(origin, 'app://').replace(rewriteFramesAssetPrefixPath, ''); |
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.
L: That's a minor code-style comment - I would move this logic (which is shorter) upward to improve readability.
EDIT(cg): Moved this functionality behind
an _experimental.thirdPartyOriginStackFrames
config flagThis change should drastically improve transparency on stack frames that come from third party origins while keeping existing sourcemapping functionality.
Example:
https://plausible.io/js/script.js
was always turned intoapp:///js/script.js
, leading the user to believe "wtf is this".By not stripping scripts on different origins from their origin in the stack trace, it should be way more transparent where errors originate from, potentially even improving sourcemaps via scraping if these scripts have propper source mapping urls/debug IDs.
Additionally, we should no longer strip js-in-html stack frames, also making those more transparent.
Considerations: