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/nextjs build not working for serverless target #3621

Closed
7 of 8 tasks
vishalvijay opened this issue May 29, 2021 · 3 comments
Closed
7 of 8 tasks

@sentry/nextjs build not working for serverless target #3621

vishalvijay opened this issue May 29, 2021 · 3 comments
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug

Comments

@vishalvijay
Copy link

vishalvijay commented May 29, 2021

Package + Version

  • @sentry/nextjs@6.4.1
  • @sentry/browser@6.4.1
  • @sentry/node@6.4.1
  • next@10.2.3

Version:

@sentry/nextjs@6.4.1

Description

@sentry/nextjs build is failing for NextJS serverless target. The issue is happening for both webpack 4 and webpack 5 (though the error messages are different).

Error message

ModuleNotFoundError: Module not found: Error: Can't resolve 'webpack' in '/Users/vishal/dev/try/next-app-with-sentry-2/node_modules/@next/react-refresh-utils'

Code to reproduce

https://github.com/vishalvijay/next-app-with-sentry-2

ENV variables required

NEXT_PUBLIC_SENTRY_DSN=https://sample
SENTRY_AUTH_TOKEN=sample
SENTRY_ORG=sample
SENTRY_PROJECT=sample

Related issue #3613

@AbhiPrasad
Copy link
Member

AbhiPrasad commented May 29, 2021

Hey, did you try using the experimental-serverless-trace target as per #3575 (comment)

@vishalvijay
Copy link
Author

Hi @AbhiPrasad

Yes, we did try with experimental-serverless-trace the build is going through, but there is another challenge that we are facing with Netlify. When we change the target to experimental-serverless-trace from serverless, the deployment gets stuck (build timeout after 20 mins) in the Netlify environment (https://github.com/netlify/netlify-plugin-nextjs). Apparently, this issue is happening only in our original project. I'm working on giving them minimal reproducible code to debug.

So the challenge for us:

  1. When we use serverless + sentry, NextJS build fails.
  2. When we use experimental-serverless-trace Netlify build fails with some other reason which is yet to be figured out. This is happening even without Sentry plugin.

But we think both the issues have to be fixed, hence we raised this issue here.

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jun 1, 2021

After discussing with the team we decided that we are not going to support the serverless target with @sentry/nextjs as the serverless target is not recommended by the NextJS team.

The @sentry/nextjs build not working for the serverless target is now intended behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants