-
-
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
Use utils in the NextJs API #9133
Comments
Hi @lucasantoniooficial thanks for writing in! I'm not the NextJS expert of this team but can you please provide a minimal reproduction example (in the form of a GH repo)? Seems like quite a few moving parts are involved and this would help us get to the bottom of this faster. Thanks! |
I can assemble it, but I won't be able to send it until next week. |
That'd be great, thanks! From taking a look at the iron-session package, I suspect it could be related to some sort of conflict between their wrappers and ours which are applied at build time. @lforst have you hear of this before? @lucasantoniooficial you could try disabeling server auto instrumentation as described here. If this fixes the error, we know we're on the right track. |
This line in the stack trace seems to be the offending part:
Maybe we should just be more defensive here. |
Hm. We're already super careful around making sure |
I'll be doing these tests and let you know |
I put the version: 7.73.0 and it resolved |
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.64.0
Framework Version
NextJs 13.3.1
Link to Sentry event
No response
SDK Setup
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "",
release:
front-end@${process.env.APP_VERSION}
,integrations: [
new Sentry.BrowserTracing(),
new Sentry.Replay(),
],
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
autoSessionTracking: true
});
Steps to Reproduce
Expected Result
API needs to work normally as it should, in case the login logs in and creates the session.
Actual Result
error - Error [TypeError]: resolver is not a function at /app/node_modules/next/dist/server/api-utils/node.js:392:16 at /app/node_modules/next/dist/server/lib/trace/tracer.js:108:36 at NoopContextManager.with (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057) at ContextAPI.with (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516) at NoopTracer.startActiveSpan (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18086) at ProxyTracer.startActiveSpan (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18847) at /app/node_modules/next/dist/server/lib/trace/tracer.js:97:107 at NoopContextManager.with (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7057) at ContextAPI.with (/app/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:516) at NextTracerImpl.trace (/app/node_modules/next/dist/server/lib/trace/tracer.js:97:32) at apiResolver (/app/node_modules/next/dist/server/api-utils/node.js:390:63) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async DevServer.runApi (/app/node_modules/next/dist/server/next-server.js:668:9) at async Object.fn (/app/node_modules/next/dist/server/next-server.js:1118:35) at async Router.execute (/app/node_modules/next/dist/server/router.js:311:32) at async DevServer.runImpl (/app/node_modules/next/dist/server/base-server.js:599:29) at async DevServer.run (/app/node_modules/next/dist/server/dev/next-dev-server.js:922:20) at async DevServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:528:20) { digest: undefined } This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: TypeError: Cannot read properties of undefined (reading 'end') at Object.autoEndTransactionOnResponseEnd (/app/node_modules/@sentry/nextjs/cjs/common/utils/responseEnd.js:33:11) at /app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:118:29 at /app/node_modules/@sentry/node/cjs/async/hooks.js:38:14 at AsyncLocalStorage.run (node:async_hooks:346:14) at Object.runWithAsyncContext (/app/node_modules/@sentry/node/cjs/async/hooks.js:37:25) at Object.runWithAsyncContext (/app/node_modules/@sentry/core/cjs/hub.js:527:36) at Object.apply (/app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:58:33) at Object.apply (/app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:25:61) at eval (webpack-internal:///(api)/./src/pages/api/auth/login.ts:25:114) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) error - unhandledRejection: Error [TypeError]: Cannot read properties of undefined (reading 'end') at Object.autoEndTransactionOnResponseEnd (/app/node_modules/@sentry/nextjs/cjs/common/utils/responseEnd.js:33:11) at /app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:118:29 at /app/node_modules/@sentry/node/cjs/async/hooks.js:38:14 at AsyncLocalStorage.run (node:async_hooks:346:14) at Object.runWithAsyncContext (/app/node_modules/@sentry/node/cjs/async/hooks.js:37:25) at Object.runWithAsyncContext (/app/node_modules/@sentry/core/cjs/hub.js:527:36) at Object.apply (/app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:58:33) at Object.apply (/app/node_modules/@sentry/nextjs/cjs/common/wrapApiHandlerWithSentry.js:25:61) at eval (webpack-internal:///(api)/./src/pages/api/auth/login.ts:25:114) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { digest: undefined }
The text was updated successfully, but these errors were encountered: