Skip to content

feat(nextjs): Improve client stack traces - #7097

Merged
lforst merged 6 commits into
developfrom
lforst-better-nextjs-client-stacktraces
Feb 9, 2023
Merged

feat(nextjs): Improve client stack traces#7097
lforst merged 6 commits into
developfrom
lforst-better-nextjs-client-stacktraces

Conversation

@lforst

Copy link
Copy Markdown
Contributor

Reading this blog post we should probably do what they're doing out of the box: https://hackernoon.com/how-to-upload-source-maps-to-sentry-with-nextjs

Also marks Next.js internal frames with in_app: false because users shouldn't care about those.

@lforst
lforst requested review from Lms24 and mydeaFebruary 8, 2023 15:30

@AbhiPrasadAbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to get a test!

@lforst

Copy link
Copy Markdown
ContributorAuthor

would be great to get a test!

Trust me it works

@github-actions

github-actionsBot commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)20.06 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified)62.19 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified)18.69 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified)55.33 KB (0%)
@sentry/browser - Webpack (gzipped + minified)20.42 KB (0%)
@sentry/browser - Webpack (minified)66.77 KB (0%)
@sentry/react - Webpack (gzipped + minified)20.45 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified)47.85 KB (+0.23% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)26.97 KB (0%)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)25.23 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified)42.28 KB (0%)
@sentry/replay - Webpack (gzipped + minified)36.7 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)59.93 KB (0%)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified)53.48 KB (0%)

@AbhiPrasad

Copy link
Copy Markdown
Contributor

@AntonBurduzha fyi

@github-actions

github-actionsBot commented Feb 9, 2023

Copy link
Copy Markdown
Contributor

Replay SDK metrics 🚀

Plain+Sentry+Replay
RevisionValueValueDiffRatioValueDiffRatio
LCPThis PR fcf17a867.27 ms89.69 ms+22.42 ms+33.34 %124.67 ms+57.40 ms+85.33 %
Previous 5c937aa74.77 ms101.57 ms+26.79 ms+35.83 %130.27 ms+55.49 ms+74.21 %
CLSThis PR fcf17a80.06 ms0.06 ms-0.00 ms-0.03 %0.06 ms+0.00 ms+0.02 %
Previous 5c937aa0.06 ms0.06 ms-0.00 ms-0.31 %0.06 ms+0.00 ms+0.54 %
CPUThis PR fcf17a812.39 %12.20 %-0.19 pp-1.51 %24.37 %+11.98 pp+96.68 %
Previous 5c937aa13.96 %13.27 %-0.70 pp-4.99 %28.44 %+14.47 pp+103.62 %
JS heap avgThis PR fcf17a81.94 MB1.99 MB+49.12 kB+2.53 %3.06 MB+1.11 MB+57.24 %
Previous 5c937aa1.93 MB2 MB+65.98 kB+3.41 %3.02 MB+1.08 MB+56.07 %
JS heap maxThis PR fcf17a82.3 MB2.56 MB+256.62 kB+11.14 %4.64 MB+2.33 MB+101.27 %
Previous 5c937aa2.3 MB2.58 MB+272.13 kB+11.81 %4.53 MB+2.22 MB+96.54 %
netTxThis PR fcf17a80 B0 B0 Bn/a2.56 kB+2.56 kBn/a
Previous 5c937aa0 B0 B0 Bn/a2.61 kB+2.61 kBn/a
netRxThis PR fcf17a80 B0 B0 Bn/a41 B+41 Bn/a
Previous 5c937aa0 B0 B0 Bn/a41 B+41 Bn/a
netCountThis PR fcf17a8000n/a1+1n/a
Previous 5c937aa000n/a1+1n/a
netTimeThis PR fcf17a80.00 ms0.00 ms0.00 msn/a73.66 ms+73.66 msn/a
Previous 5c937aa0.00 ms0.00 ms0.00 msn/a68.14 ms+68.14 msn/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
5c937aa+55.49 ms+0.00 ms+14.47 pp+1.08 MB+2.22 MB+2.61 kB+41 B+1+68.14 ms
45638e4+71.80 ms+0.00 ms+21.94 pp+1.1 MB+2.26 MB+2.61 kB+41 B+1+98.15 ms
b539b36+53.97 ms-0.00 ms+16.53 pp+1.12 MB+2.23 MB+2.61 kB+41 B+1+114.29 ms
6462b00+62.18 ms+0.00 ms+23.70 pp+1.1 MB+2.23 MB+2.57 kB+41 B+1+117.17 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Thu, 09 Feb 2023 09:39:01 GMT

@lforst

Copy link
Copy Markdown
ContributorAuthor

@AbhiPrasad I caved and added tests and only potentially discovered an edge case lol

@AbhiPrasad

Copy link
Copy Markdown
Contributor

@AbhiPrasad I caved and added tests and only potentially discovered an edge case lol

79096ca119b85ed399e93d34383d8aea

if (
frame.filename &&
frame.filename.match(
/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this have any possible issues with windows paths?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just on the client so we're good

@lforst
lforst merged commit 538c3a6 into developFeb 9, 2023
@lforst
lforst deleted the lforst-better-nextjs-client-stacktraces branch February 9, 2023 15:04
@smeubanksmeubank mentioned this pull request Feb 21, 2023
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@lforst@AbhiPrasad