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 warning on install about missing webpack #4632

Closed
3 tasks done
belgattitude opened this issue Feb 24, 2022 · 1 comment · Fixed by #4634
Closed
3 tasks done

sentry/nextjs warning on install about missing webpack #4632

belgattitude opened this issue Feb 24, 2022 · 1 comment · Fixed by #4634
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug

Comments

@belgattitude
Copy link
Contributor

belgattitude commented Feb 24, 2022

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

6.17.9

Framework Version

Non applicable

Link to Sentry event

Non applicable

Steps to Reproduce

Run an install or @sentry/nextjs with yarn 3 (or 2) - repo link https://github.com/belgattitude/nextjs-sentry-reproduction.

Note that this would theoretically also prevent @sentry/nextjs to work with the pnp/pnpm module linker.

git clone https://github.com/belgattitude/nextjs-sentry-reproduction
cd nextjs-sentry-reproduction
yarn install

Expected Result

No warning about missing peer-dependencies on webpack.

Note: webpack is provided by nextjs as a ncc'ed dep since vercel/next.js#32742

Actual Result

➤ YN0000: ┌ Resolution step
➤ YN0002: │ root-workspace-0b6124@workspace:. doesn't provide webpack (p08419), requested by @sentry/nextjs
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed

Running explain:

yarn explain peer-requirements p08419
➤ YN0000: root-workspace-0b6124@workspace:. doesn't provide webpack, breaking the following requirements:
➤ YN0000: @sentry/nextjs@npm:6.17.9 [dc3fc]         → >= 4.0.0           ✘
➤ YN0000: @sentry/webpack-plugin@npm:1.18.5 [5d4cb] → ^4.41.31 || ^5.0.0 ✘
➤ YN0000: Note: these requirements start with @sentry/nextjs@npm:6.17.9 [dc3fc]

Workaround

It's possible to use the packageExtensions in yarnrc.yml.

packageExtensions:
  '@sentry/nextjs@*':
    peerDependenciesMeta:
      webpack:
        optional: true
@belgattitude
Copy link
Contributor Author

Opened a P/R here: #4634.

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
2 participants