Skip to content

fix(nextjs): Start navigation transactions on same-route navigations #5642

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

Merged
merged 4 commits into from
Aug 29, 2022

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Aug 29, 2022

Fixes #5641

Currently we are not starting transactions in Next.js when navigating from one page to another, but within the same route (eg. from /users/42 to /users/1337, both are on the same route /users/[id]).

This PR fixes this by starting a transaction for those navigations by looking at the window pathname instead. (See code changes for reason why we're not starting transactions when just the query string changes)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 29, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.41 KB (+0.02% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 60.06 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.98 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 52.92 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 19.77 KB (0%)
@sentry/browser - Webpack (minified) 64.31 KB (0%)
@sentry/react - Webpack (gzipped + minified) 19.79 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 44.71 KB (+0.02% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.9 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.27 KB (+0.01% 🔺)

@lforst lforst merged commit 7633952 into master Aug 29, 2022
@lforst lforst deleted the lforst-fix-same-route-navigations branch August 29, 2022 19:17
Sign up for free to 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.

Next.js navigation transactions are broken for same-route navigations
2 participants