-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Milestone
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
@sentry/nextjs
Version:
6.13.3
Description
After upgrading a project from Next 11.1.2 to 12.0.1, the Next.js-powered API endpoints start to crash, as in https://drafted-webapp-hmopbeh9f-davidguijarro.vercel.app/api/status.
Here's a sample log of the error:
[GET] /api/status
09:32:11:52
2021-10-29T07:32:12.548Z 1c5c0769-4fd8-4480-8b9a-08598598cd1f ERROR Error: Cannot find module './browser'
Require stack:
- /var/task/node_modules/@sentry/tracing/dist/index.js
- /var/task/node_modules/@sentry/node/dist/handlers.js
- /var/task/node_modules/@sentry/node/dist/index.js
- /var/task/node_modules/@sentry/nextjs/dist/index.server.js
- /var/task/.next/server/pages/api/status.js
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.js
- /var/runtime/UserFunction.js
- /var/runtime/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/var/task/node_modules/@sentry/tracing/dist/index.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/var/task/node_modules/@sentry/tracing/dist/index.js',
'/var/task/node_modules/@sentry/node/dist/handlers.js',
'/var/task/node_modules/@sentry/node/dist/index.js',
'/var/task/node_modules/@sentry/nextjs/dist/index.server.js',
'/var/task/.next/server/pages/api/status.js',
'/var/task/node_modules/next/dist/server/next-server.js',
'/var/task/___next_launcher.js',
'/var/runtime/UserFunction.js',
'/var/runtime/index.js'
]
}
RequestId: 1c5c0769-4fd8-4480-8b9a-08598598cd1f Error: Runtime exited with error: exit status 1
Runtime.ExitError
Weird enough, this only happens when deployed to Vercel, not when running on local.
I also confirmed that completely removing Sentry from the project solves the issue.
alexhansonsmith, dasblitz, tonimasc, dferber90, oguzgelal and 32 moreatilafassina, taylorbryant, antaiSlasify, klaasman, ian97531 and 4 more
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK