Skip to content

vitest type issue (WeakKey type)  #3381

@gabrocheleau

Description

@gabrocheleau

At this moment, the only remaining type issue in the monorepo is the following:

+ tsc -p ./tsconfig.json --noEmit
../../node_modules/@vitest/utils/dist/error.d.ts:4:58 - error TS2304: Cannot find name 'WeakKey'.

4 declare function serializeError(val: any, seen?: WeakMap<WeakKey, any>): any;
                                                           ~~~~~~~

../../node_modules/@vitest/utils/dist/error.d.ts:6:96 - error TS2304: Cannot find name 'WeakKey'.

6 declare function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced?: WeakSet<WeakKey>, expectedReplaced?: WeakSet<WeakKey>): {
                                                                                                 ~~~~~~~

../../node_modules/@vitest/utils/dist/error.d.ts:6:133 - error TS2304: Cannot find name 'WeakKey'.

6 declare function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced?: WeakSet<WeakKey>, expectedReplaced?: WeakSet<WeakKey>): {
                                                                                                                                      ~~~~~~~

../../node_modules/vite/dist/node/index.d.ts:5:41 - error TS2307: Cannot find module 'rollup/parseAst' or its corresponding type declarations.

5 export { parseAst, parseAstAsync } from 'rollup/parseAst';
                                          ~~~~~~~~~~~~~~~~~

This seems to correspond to this issue: vitest-dev/vitest#4921

From researching the issue, it seems to be related to this TS feature: microsoft/TypeScript#54195 which is part of TypeScript 5.2. For context, we are on version 4.7.4.

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