-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(nextjs/instrumentation): warn about missing onRequestError handler #15488
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@@ -56,6 +56,7 @@ export function constructWebpackConfigFunction( | |||
|
|||
if (runtime !== 'client') { | |||
warnAboutDeprecatedConfigFiles(projectDir, runtime); | |||
warnAboutMissingonRequestErrorHandler(projectDir); |
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.
Let's do this only for runtime === 'nodejs'
.
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.
the runtime is either: client | edge | server
I used server
for now
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 right. Yeah perfect
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
and only warn about missing onRequestError when an instrumentation file exists
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
@a-hariti please use squash-merge next time 🙏 |
const instrumentationPaths = [ | ||
['src', 'instrumentation.ts'], | ||
['src', 'instrumentation.js'], | ||
['instrumentation.ts'], | ||
['instrumentation.js'], | ||
]; |
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.
Looks like this approach does not respect pageExtensions
in Next.js config. I created #15652 to track this bug.
closes #15049
Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint
) & (yarn test
).