-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
TypeScript error when using Yarn PnP #4391
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
Comments
Can confirm that adding:
to |
Yeah, I wonder why it worked before. I noticed a rogue Vitest doesn't depend on rollup directly, Vite does, so I don't think we can specify it. However, this should change with #4368 when we upgrade to rollup 4 and have to use |
Can confirm, this is just what For now, we can just make the same interface manually and return it there, I guess. |
0.33.0 didn't have it as far as I can see. 0.34.0 added the import in |
Describe the bug
Error
The following error may appear while type checking, if using Yarn PnP:
Why this happens:
vitest
importsrollup
, while not declaring it as its dependency. This is illegal in Yarn PnP, and works "by miracle" in non-PnP setups.Here's why.
Imagine
vitest
relies on[email protected]
which in turn relies onbar
.foo
's maintainer finds a way to get rid ofbar
dependency without changing its public API. Releases this improvement as a non-breaking version, righfully so.Now, if you relied on
foo
to providevitest
withbar
, everything falls apart.In fact, with Vite plans to replace
rollup
withrolldown
the above is EXACTLY what might happen.What we can do about it
Declare
rollup
asvitest
's dependency.Reproduction
n/a
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: