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

Upgrade VitePress to use Vite v6 #4494

Open
4 tasks done
simensol opened this issue Jan 16, 2025 · 1 comment
Open
4 tasks done

Upgrade VitePress to use Vite v6 #4494

simensol opened this issue Jan 16, 2025 · 1 comment
Labels
build Related to the build system
Milestone

Comments

@simensol
Copy link

Is your feature request related to a problem? Please describe.

I recently upgraded my project to use Vite v6. However, I encountered type conflicts between VitePress and my project due to VitePress using Vite v5. The error message is as follows:

Type 'import("/code/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").PluginOption'.
  Type 'Plugin<any>' is not assignable to type 'PluginOption'.
    Type 'import("/code/node_modules/vite/dist/node/index").Plugin<any>' is not assignable to type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").Plugin<any>'.
      Types of property 'apply' are incompatible.
        Type '"serve" | "build" | ((this: void, config: import("/code/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"serve" | "build" | ((this: void, config: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
          Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
            Type '(this: void, config: import("/code/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
              Types of parameters 'config' and 'config' are incompatible.
                Type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/code/node_modules/vite/dist/node/index").UserConfig'.
                  Types of property 'plugins' are incompatible.
                    Type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/code/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
                      Type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/code/node_modules/vite/dist/node/index").PluginOption[]'.
                        Type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/code/node_modules/vite/dist/node/index").PluginOption'.
                          Type 'Plugin<any>' is not assignable to type 'PluginOption'.
                            Type 'import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").Plugin<any>' is not assignable to type 'import("/code/node_modules/vite/dist/node/index").Plugin<any>'.
                              Types of property 'apply' are incompatible.
                                Type '"serve" | "build" | ((this: void, config: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vitepress/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"serve" | "build" | ((this: void, config: import("/code/node_modules/vite/dist/node/index").UserConfig, env: import("/code/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
                                  Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean)

Describe the solution you'd like

To resolve this, could you please upgrade VitePress to use Vite v6? This will help avoid type conflicts and ensure compatibility with projects using the latest version of Vite.

Describe alternatives you've considered

No response

Additional context

The plugins causing this issue are vite-plugin-vue-devtools and vite-plugin-vuetify. These plugins are used in the Vite configuration within VitePress:

export default defineConfig({
    ...
    vite: {
        ...
        plugins: [
            vueDevTools(),
            vuetify({
                autoImport: true,
                styles: { configFile: "../../src/styles/settings.scss" }
            })
        ],
    ...
})

Validations

@brc-dd
Copy link
Member

brc-dd commented Jan 19, 2025

It is planned (#4467). Some features don't work properly, but you can force vite 6 using overrides (npm, pnpm). It should work fine if you're not using data and path loaders.

@brc-dd brc-dd added this to the v2.0 milestone Jan 19, 2025
@brc-dd brc-dd added the build Related to the build system label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system
Projects
None yet
Development

No branches or pull requests

2 participants