-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@types/chai conflict with @vitest/expect/dist/chai.d.cts #4688
Comments
Why do you have |
@sheremet-va they are indirect/nested deps
|
I wonder if this should be fixed on storybook side - they are using chai to use We can also try to improve |
@sheremet-va I removed the
|
https://github.com/testing-library/jest-dom/blob/main/package.json#L104 seems like to resolve this, everyone else has to remove their |
This is a dev dependency, it's not installed. jest-dom has a peer dependency of Vitest which should just reuse existing one. Try deleting a lockfile and installing everything again. |
@sheremet-va I just created a minimal reproduction...
|
the way I see this, any other package that has |
one more reproduction, this time with the https://stackblitz.com/edit/vitest-dev-vitest-qwc3pw?file=package.json |
Hi, we have also this issue. We have huge monorepo (~400 packages/rush/pnpm), we are on the mocha/chai/sinon, and we made a try to migrate package by package to vitests. In general tests runs well, but compilation (type checking) on packages where we are using the vitest fails with:
The package itself is not depends on the tsc --explainFiles says:
In vitest 0.34 there was no such problem as vitest used the |
Did someone find a workaround for this? This is very cumbersome… |
Okay, I just found that adding |
Trying to fix this in the next patch release of |
This seems to be Vitest issue. Chai is obviously should not be included along with user facing |
I see a similar problem after upgrading vitest from 2.0.4 to 2.0.5 Without having node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:17:23 - error TS7016: Could not find a declaration file for module 'chai'. '.../node_modules/chai/chai.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/chai` if it exists or add a new declaration (.d.ts) file containing `declare module 'chai';`
17 import * as chai from 'chai';
~~~~~~
Found 1 error in node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:17 After installing node_modules/@types/chai/index.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai
1 declare namespace Chai {
~~~~~~~
node_modules/@vitest/expect/dist/chai.d.cts:16:1
16 declare namespace Chai {
~~~~~~~
Conflicts are in this file.
node_modules/@vitest/expect/dist/chai.d.cts:16:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai
16 declare namespace Chai {
~~~~~~~
node_modules/@types/chai/index.d.ts:1:1
1 declare namespace Chai {
~~~~~~~
Conflicts are in this file.
Found 2 errors in 2 files.
Errors Files
1 node_modules/@types/chai/index.d.ts:1
1 node_modules/@vitest/expect/dist/chai.d.cts:16 |
* Update vitest monorepo to v2 * Remove "--sequence.concurrent" as it caused failure in some packages * Revert to `vitest` 2.0.4 as 2.0.5 has more Chai problems: vitest-dev/vitest#4688 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Øyvind Smestad <[email protected]>
- replace version to "~5.6.2" - rush update - add `"skipLibCheck": true` for several packages that are affected by vitest-dev/vitest#4688
***NO_CI*** - replace version to "~5.6.2" - rush update - add `"skipLibCheck": true` for several packages that are affected by vitest-dev/vitest#4688
***NO_CI*** - replace version to "~5.6.2" - rush update - add `"skipLibCheck": true` for several packages that are affected by vitest-dev/vitest#4688
***NO_CI*** - replace version to "~5.6.2" - rush update - add `"skipLibCheck": true` for several packages that are affected by vitest-dev/vitest#4688
***NO_CI*** - replace version to "~5.6.2" - rush update - add `"skipLibCheck": true` for several packages that are affected by vitest-dev/vitest#4688 - [formrecognizer] help TypeScript to understand with more explicit type - [schema-registry-{avro,json}] skip lib check due to lru-cache issue with the Iterator TReturn change isaacs/node-lru-cache#348
Running into this too. So, I have a monorepo |
Seeing it happen in a codebase with |
Describe the bug
since v1.0.0-beta.1
5996c8c0
I get the following:
In case it matters, this is an NPM workspace project.
If I delete the file
node_modules/vitest/node_modules/@vitest/expect/dist/chai.d.cts
everything compiles successfully like before the upgrade to v1.0.0-beta.1.Reproduction
install and try to compile without skipLibCheck: true in tsconfig
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: