Skip to content

@types/chai conflict with @vitest/expect/dist/chai.d.cts #4688

@antoniosZ

Description

@antoniosZ

Describe the bug

since v1.0.0-beta.1
5996c8c0

I get the following:

../../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/node_modules/@vitest/expect/dist/chai.d.cts:16:1
    16 declare namespace Chai {
       ~~~~~~~
    Conflicts are in this file.

../../node_modules/vitest/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.

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

System:
    OS: macOS 13.6.1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.2.1 - ~/my-project/node_modules/.bin/npm
  npmPackages:
    @vitest/coverage-v8: ^1.0.1 => 1.0.1 
    vite: ^5.0.6 => 5.0.6

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions