-
-
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): Emit warning when using turbopack #13566
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -103,6 +103,15 @@ function getFinalConfigObject( | |||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
if (process.env.TURBOPACK && !process.env.SENTRY_SUPPRESS_TURBOPACK_WARNING) { | ||||||||||
// eslint-disable-next-line no-console | ||||||||||
console.warn( | ||||||||||
`[@sentry/nextjs] WARNING: You are using the Sentry SDK with \`next ${ | ||||||||||
process.env.NODE_ENV === 'development' ? 'dev' : 'build' | ||||||||||
} --turbo\`. The Sentry SDK doesn't yet fully support Turbopack. The SDK will not be loaded in the browser, and serverside instrumentation will be inaccurate or incomplete. Production builds will still fully work. If you are just trying out Sentry or attempting to configure the SDK, we recommend temporarily removing the \`--turbo\` flag while you are developing locally. Follow this issue for progress on Sentry + Turbopack: https://github.com/getsentry/sentry-javascript/issues/8105. (You can suppress this warning by setting SENTRY_SUPPRESS_TURBOPACK_WARNING=1 as environment variable)`, | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. l/feel free to disregard: I'd add some line breaks to make this warning a bit more readable. Maybe even double breaks would work 🤔 Maybe just personal taste though...
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this SDK I generally put all logs into one line, because in certain situations there may be more than one log/warning and messages would have a tendency to "bleed into eachother". I'd say it's easier to parse if it is one concern per line. Opinion not strongly held. |
||||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
return { | ||||||||||
...incomingUserNextConfigObject, | ||||||||||
webpack: constructWebpackConfigFunction(incomingUserNextConfigObject, userSentryOptions), | ||||||||||
|
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.
Should we restrict to only show this warning in dev mode? No strong feelings, was only wondering because the warning says things work fine in prod.
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.
Oh good point, if the user does only use --turbo for dev, everything will be fine, but if they use it for prod, it gets funky. Need to update the message.