-
-
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
Sentry is not reporting the errors as well as the performance for the NextJS 13 app routing #9045
Comments
You're using the wrong wrapper for the route handler. You would need to use |
I think I saw it somewhere, I'm not able to remember where I saw that, but I did tried this import NextAuth from 'next-auth';
import { options } from './options';
import { withSentry, wrapRouteHandlerWithSentry } from '@sentry/nextjs';
const handler = NextAuth(options);
export { handler as GET, handler as POST };
export default wrapRouteHandlerWithSentry(handler, '/api.name.io'); It's giving an error like |
But one thing I do not understand is why it's not logging the correct routes in the performance, it's just logging as unknow-server something like that @lforst |
Please take a proper look at the type definition for |
Can you please provide me the link to it, I did search for that on docs but I'm unable to find it, I found only this |
|
function wrapRouteHandlerWithSentry<F extends (...args: any[]) => any>(
routeHandler: F,
context: RouteHandlerContext,
): (...args: Parameters<F>) => ReturnType<F> extends Promise<unknown> ? ReturnType<F> : Promise<ReturnType<F>>;
export interface RouteHandlerContext {
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
parameterizedRoute: string;
sentryTraceHeader?: string;
baggageHeader?: string;
}
|
@lforst import NextAuth from 'next-auth';
import { options } from './options';
const handler = NextAuth(options);
export { handler as GET, handler as POST };
/** @type {import('next').NextConfig} */
const { withSentryConfig } = require("@sentry/nextjs");
const nextConfig = {
sentry: {
hideSourceMaps: false,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'backend-data.s3.amazonaws.com',
port: '',
},
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
port: '',
},
],
},
}
const sentryConfig = {
silent: true,
org: "org-c423d51af",
project: "project",
authToken: process.env.SENTRY_AUTH_TOKEN ?? '',
}
module.exports = withSentryConfig(nextConfig, sentryConfig); I made the changes you mentioned but still, I am not sure why it's not reporting the errors or the performance logs with the correct endpoints |
What do your logs say? |
When I pass directly the DSN value then I am able to capture the error and it's reporting the error, so in the Vercel do I have to set the env like |
Set it like |
I think most of the things are working now with errors and the performance, only profiling is left, should I just create an issue for that @lforst ? |
I need to look into how nextjs 13 can be configured to load .node modules - the error you are seeing is thrown whenever a loader for a file is not configured so the bundler doesn't know what to do with that file type. Do you know if this is using turbopack by any chance? |
Sorry for late. No I'm not using the turbo. I already removed it @JonasBa |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.69.0
Framework Version
NextJS 13.4.7
Link to Sentry event
No response
SDK Setup
sentry.client.config.ts
sentry.server.config.ts
sentry.properties
next.config.ts
setup 1
next.config.ts
setup 2
app > api > auth > [...nextauth]> route.ts
I am using nextAuth
Package Modules
page.tsx
I did not include the sentry.edge.config.ts as it's the same as the server
Steps to Reproduce
I did not get any errors on the consoles, but I do have the logs I think it might be helpful for you to trace it
Expected Result
It should log the API errors and all types of errors, and log the correct performance endpoints instead of the
Actual Result
It's not reporting/logging any errors and logging incorrect endpoints
The below is from the performance
The text was updated successfully, but these errors were encountered: