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

I'm running into the exact same issue here. Have you found a (temporary) workaround? Currently I'm using this in my tsconfig:

    "skipLibCheck": true, // Remove when https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/354 is resolved

casjonker avatar Jul 27 '23 09:07 casjonker

Thanks for writing in!

Unfortunately the dependencies come from the unplugin package and I currently don't know how I would sustainably resolve this issue. We're open to any suggestions!

Short to mid-term plans are to move away from unplugin anyhow. This will implicitly be resolved then.

lforst avatar Jul 31 '23 08:07 lforst

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Aug 22 '23 00:08 github-actions[bot]

Should this stay open?

I have now also created this unplugin issue: https://github.com/unjs/unplugin/issues/349 but given how it's designed to work and limitations of npm, I'm not sure there is anything it could do to fix this issue though...

rchl avatar Nov 08 '23 11:11 rchl

Yes sorry. This shouldn't be closed. Plan is still to move away from unplugin.

lforst avatar Nov 08 '23 14:11 lforst

I'm not interested in this work going forward. If folks still want it open, feel free to reopen.

wegry avatar Jun 19 '24 19:06 wegry

For anybody running into this, as a workaround, try not to point tsc to your build config.

lforst avatar Jun 20 '24 11:06 lforst