Skip to content

Breaking changes in Vitest 0.34 #328

Closed
@wxh06

Description

@wxh06

Vitest introduced a few breaking changes in 0.34.0: https://github.com/vitest-dev/vitest/releases/tag/v0.34.0

Simply upgrading Vitest to 0.34 in generated project will cause error TS2345 in vitest.config.ts:

Argument of type 'UserConfig & Promise<UserConfig> & UserConfigFnObject & UserConfigExport' is not assignable to parameter of type 'never'.
  Type 'UserConfig & Promise<UserConfig> & UserConfigFnObject' is not assignable to type 'never'.

Here's my workaround (not pretty at all):

-import { mergeConfig, defineConfig } from 'vite'
+import { mergeConfig, defineConfig, UserConfig } from 'vite'

-export default mergeConfig(
+export default mergeConfig<UserConfig, UserConfig>(

Then I got TS2769 due to the breaking change of transformMode mentioned in Vitest 0.34.0 changelog:

No overload matches this call.
  The last overload gave the following error.

Hopefully, someone can help update Vitest to 0.34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions