Skip to content
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

fix(next): Inject SDK in dev mode #6368

Merged
merged 1 commit into from Dec 2, 2022
Merged

Conversation

lforst
Copy link
Member

@lforst lforst commented Dec 1, 2022

Fixes #6321

In #6206 we switched up our logic not to always include the SDK on /app route. This broke the injection mechanism in dev mode where _app is the only entry point that is always hit. In dev mode, pages defined by the user are not considered entry points so they were skipped by our injection logic.

This PR fixes this by always injecting the SDK into _app in dev mode. This is probably not optimal because it doesn't really reflect what is happening when a Next.js is built using prod mode but it's as close as we can get with reasonable effort.

@lforst lforst self-assigned this Dec 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.57 KB (-0.03% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.59 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.36 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 54.15 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.12 KB (0%)
@sentry/browser - Webpack (minified) 65.75 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.14 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.97 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.41 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.85 KB (+0.01% 🔺)
@sentry/replay index.js 37.2 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 37.17 KB (0%)
@sentry/replay - Webpack (minified) 124.99 KB (0%)

Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

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

LGTM!

@lforst lforst merged commit 87893a9 into master Dec 2, 2022
@lforst lforst deleted the lforst-inject-sdk-in-dev-mode branch December 2, 2022 10:19
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 SDK not injected in dev mode
2 participants