Skip to content
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 working on my local but not on production deployed in vercel #6265

Closed
3 tasks done
roblegaspi opened this issue Nov 23, 2022 · 5 comments · Fixed by #6267
Closed
3 tasks done

Sentry is working on my local but not on production deployed in vercel #6265

roblegaspi opened this issue Nov 23, 2022 · 5 comments · Fixed by #6267

Comments

@roblegaspi
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.21.0

Framework Version

@sentry/nextjs

Link to Sentry event

No response

Steps to Reproduce

  1. intrall @sentry/nextjs
  2. create page with getServerSideProps
  3. deploy app to vercel

Expected Result

The page to load with no issue

Actual Result

Uploading image.png…

[GET] /login
11:31:32:81
Function Status:
None
Edge Status:
500
Duration:
111.82 ms
Init Duration:
N/A
Memory Used:
60 MB
ID:
sin1::gzk9v-1669174293167-9e37795d4ec1
User Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
2022-11-23T03:31:33.051Z e96e7e5e-5f9e-41f6-a3c6-11fa309c3416 ERROR Error: Cannot find module './config/withSentryConfig.js'
Require stack:

  • /var/task/node_modules/@sentry/nextjs/cjs/index.server.js
  • /var/task/.next/server/pages/_document.js
  • /var/task/node_modules/next/dist/server/require.js
  • /var/task/node_modules/next/dist/server/next-server.js
  • /var/task/___next_launcher.cjs
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.mod._resolveFilename (/var/task/node_modules/next/dist/build/webpack/require-hook.js:27:32)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object. (/var/task/node_modules/@sentry/nextjs/cjs/index.server.js:19:26)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/var/task/node_modules/@sentry/nextjs/cjs/index.server.js',
    '/var/task/.next/server/pages/_document.js',
    '/var/task/node_modules/next/dist/server/require.js',
    '/var/task/node_modules/next/dist/server/next-server.js',
    '/var/task/___next_launcher.cjs'
    ],
    page: '/login'
    }
    RequestId: e96e7e5e-5f9e-41f6-a3c6-11fa309c3416 Error: Runtime exited with error: exit status 1
    Runtime.ExitError
@AndreyMarchuk
Copy link

  • same issue using @sentry/nextjs v7.21.0
  • downgrade to v7.20.0 resolves the issue

@Nappsel
Copy link

Nappsel commented Nov 23, 2022

Confirm, have a same issue.
On the local environment, everything works fine, but after building the production, I see the following error in the docker for each page request.

Downgrade to v7.20.1 resolves the issue.

Error: Cannot find module './config/withSentryConfig.js'
app    | Require stack:
app    | - /app/node_modules/@sentry/nextjs/cjs/index.server.js
app    | - /app/.next/server/pages/_document.js
app    | - /app/node_modules/next/dist/server/require.js
app    | - /app/node_modules/next/dist/server/next-server.js
app    | - /app/server.js
app    |     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
app    |     at Function.mod._resolveFilename (/app/node_modules/next/dist/build/webpack/require-hook.js:27:32)
app    |     at Function.Module._load (node:internal/modules/cjs/loader:833:27)
app    |     at Module.require (node:internal/modules/cjs/loader:1057:19)
app    |     at require (node:internal/modules/cjs/helpers:103:18)
app    |     at Object.<anonymous> (/app/node_modules/@sentry/nextjs/cjs/index.server.js:19:26)
app    |     at Module._compile (node:internal/modules/cjs/loader:1155:14)
app    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
app    |     at Module.load (node:internal/modules/cjs/loader:1033:32)
app    |     at Function.Module._load (node:internal/modules/cjs/loader:868:12) {
app    |   code: 'MODULE_NOT_FOUND',
app    |   requireStack: [
app    |     '/app/node_modules/@sentry/nextjs/cjs/index.server.js',
app    |     '/app/.next/server/pages/_document.js',
app    |     '/app/node_modules/next/dist/server/require.js',
app    |     '/app/node_modules/next/dist/server/next-server.js',
app    |     '/app/server.js'
app    |   ]
app    | }

SDK Version
7.21.0

Next.js Version
12.3.1

@lobsterkatie
Copy link
Member

lobsterkatie commented Nov 23, 2022

Hi, all.

Thanks for reporting this! I believe I know what the problem is, and I'm working on a fix. Until then, as you have discovered, downgrading to 7.20 should solve the problem.

@lforst
Copy link
Member

lforst commented Nov 23, 2022

@roblegaspi Hi, we just released version 7.21.1. Can you check whether upgrading fixes this problem for you?

@roblegaspi
Copy link
Author

roblegaspi commented Nov 23, 2022

Hi @lforst , It is confirmed that @sentry/nextjs version 7.21.1 fixed the issue. Thanks mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants