Skip to content

Breaking changes in Vitest 0.34 #328

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy