sentry-javascript-bundler-plugins icon indicating copy to clipboard operation
sentry-javascript-bundler-plugins copied to clipboard

@sentry/[email protected] installing extra packages with yarn 3 that break [email protected]

Open wegry opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.60.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

  1. Using [email protected], yarn add @sentry/[email protected].
  2. Run [email protected] with yarn tsc.
  3. See tsc with errors such as
.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:1:84 - error TS2307: Cannot find module 'rollup' or its corresponding type declarations.

1 import { SourceMapInput, EmittedAsset, AcornNode, Plugin, PluginContextMeta } from 'rollup';
                                                                                     ~~~~~~~~

.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:2:40 - error TS2307: Cannot find module 'rollup' or its corresponding type declarations.

2 export { Plugin as RollupPlugin } from 'rollup';
                                         ~~~~~~~~

.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:5:36 - error TS2307: Cannot find module 'vite' or its corresponding type declarations.

5 import { Plugin as Plugin$1 } from 'vite';
                                     ~~~~~~

.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:6:38 - error TS2307: Cannot find module 'vite' or its corresponding type declarations.

6 export { Plugin as VitePlugin } from 'vite';
                                       ~~~~~~

.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:7:49 - error TS2307: Cannot find module 'esbuild' or its corresponding type declarations.

7 import { Plugin as Plugin$2, PluginBuild } from 'esbuild';
                                                  ~~~~~~~~~

.yarn/cache/unplugin-npm-1.0.1-70bc9bb0e2-b6bf00dcc7.zip/node_modules/unplugin/dist/index.d.ts:8:41 - error TS2307: Cannot find module 'esbuild' or its corresponding type declarations.

8 export { Plugin as EsbuildPlugin } from 'esbuild';
                                          ~~~~~~~~~
  1. Run yarn why -R unplugin and see
├─ @org/package@workspace:package
│  └─ @sentry/webpack-plugin@npm:2.4.0 [e43e3] (via npm:^2.4.0 [e43e3])
│     ├─ @sentry/bundler-plugin-core@npm:2.4.0 (via npm:2.4.0)
│     │  └─ unplugin@npm:1.0.1 (via npm:1.0.1)
│     └─ unplugin@npm:1.0.1 (via npm:1.0.1)

Expected Result

tsc should not report errors because a package doesn't correctly record which dependencies it needs. Yarn is stricter than npm in this regard.

Actual Result

https://github.com/unjs/unplugin/blob/main/package.json#L34 doesn't seem to specify the dependencies it's reaching out for.

wegry avatar Jul 24 '23 12:07 wegry