Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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