Skip to content
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

Vite v4 config types incompatible #2474

Closed
6 tasks done
JoostKersjes opened this issue Dec 9, 2022 · 2 comments
Closed
6 tasks done

Vite v4 config types incompatible #2474

JoostKersjes opened this issue Dec 9, 2022 · 2 comments

Comments

@JoostKersjes
Copy link

Describe the bug

When upgrading to Vite 4.0.0 running a TypeScript check will now think that the test config for vitest is invalid. This is the TS error in question:

error TS2345: Argument of type '{ plugins: Plugin_2[]; resolve: { alias: { "@": string; }; }; server: { port: number; }; test: { globals: boolean; environment: string; include: string[]; }; build: { target: string; }; }' is not assignable to parameter of type 'UserConfigExport'.
  Object literal may only specify known properties, and 'test' does not exist in type 'UserConfigExport'.

 24   test: {
      ~~~~~~~
 25     globals: true,
    ~~~~~~~~~~~~~~~~~~
... 
 27     include: ["**/__tests__/*.test.ts"],
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 28   },

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-1gphuh?file=vite.config.ts

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
    Memory: 8.08 GB / 15.31 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Browsers:
    Chromium: 108.0.5359.94
    Firefox: 107.0.1
  npmPackages:
    @vitejs/plugin-vue: 3.2.0 => 3.2.0 
    vite: 4.0.0 => 4.0.0 
    vitest: 0.25.6 => 0.25.6

Used Package Manager

yarn

Validations

@christopherschroer
Copy link

christopherschroer commented Dec 10, 2022

The PR #2470 appears to address this. Hopefully, it ends up getting merged quickly.

@sheremet-va
Copy link
Member

Fixed by #2470
Released as part of 0.25.7

@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants