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 5 support ? #389

Open
marckraw opened this issue May 23, 2024 · 1 comment
Open

Vite 5 support ? #389

marckraw opened this issue May 23, 2024 · 1 comment
Assignees
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed

Comments

@marckraw
Copy link

Just tried to update to Vite 5, to be on the newest version, and having this errors, is the plugins support Vite 5 and i'm doping something wrong, or it's not supported yet ? :) sending also my vite.config.ts (but its basically boilerplate one)

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import cssInjectedByJs from 'vite-plugin-css-injected-by-js'
import { plugins } from '@storyblok/field-plugin/vite'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), cssInjectedByJs(), ...plugins],
  build: {
    rollupOptions: {
      output: {
        format: 'commonjs',
        entryFileNames: `[name].js`,
        chunkFileNames: `[name].js`,
        assetFileNames: `[name].[ext]`,
      },
    },
  },
  server: {
    port: 8080,
    host: true,
  },
})


@ef-global/backpack-sb-plugins-common:lint: vite.config.ts:8:22 - error TS2769: No overload matches this call.
@ef-global/backpack-sb-plugins-common:lint:   The last overload gave the following error.
@ef-global/backpack-sb-plugins-common:lint:     Type 'Plugin<any>[]' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:       Type 'Plugin<any>[]' is not assignable to type 'PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:         Type 'Plugin<any>' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:           Type 'Plugin<any>' is not assignable to type 'Plugin_2'.
@ef-global/backpack-sb-plugins-common:lint:             Types of property 'apply' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:               Type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean) |...'.
@ef-global/backpack-sb-plugins-common:lint:                 Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                   Type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
@ef-global/backpack-sb-plugins-common:lint:                     Types of parameters 'config' and 'config' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                       Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig'.
@ef-global/backpack-sb-plugins-common:lint:                         Types of property 'plugins' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                           Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                             Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:                               Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                 Type 'Plugin_2' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                   Type 'Plugin_2' is not assignable to type 'Plugin<any>'.
@ef-global/backpack-sb-plugins-common:lint:                                     Types of property 'apply' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                       Type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean) |...' is not assignable to type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                         Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                           Type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
@ef-global/backpack-sb-plugins-common:lint:                                             Types of parameters 'config' and 'config' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                               Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig'.
@ef-global/backpack-sb-plugins-common:lint:                                                 Types of property 'plugins' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                                   Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                     Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:                                                       Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                                         Type 'Promise<false | Plugin<any> | PluginOption[] | null | undefined>' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                                           Type 'Promise<false | Plugin<any> | PluginOption[] | null | undefined>' is not assignable to type 'Promise<false | Plugin_2 | PluginOption[] | null | undefined>'.
@ef-global/backpack-sb-plugins-common:lint:                                                             Type 'false | Plugin<any> | PluginOption[] | null | undefined' is not assignable to type 'false | Plugin_2 | PluginOption[] | null | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                               Type 'Plugin<any>' is not assignable to type 'false | Plugin_2 | PluginOption[] | null | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                                 Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: 8   plugins: [react(), cssInjectedByJs(), ...plugins],
@ef-global/backpack-sb-plugins-common:lint:                        ~~~~~~~~~~~~~~~~~
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint:   node_modules/vite/dist/node/index.d.ts:579:25
@ef-global/backpack-sb-plugins-common:lint:     579 export declare function defineConfig(config: UserConfigExport): UserConfigExport;
@ef-global/backpack-sb-plugins-common:lint:                                 ~~~~~~~~~~~~
@ef-global/backpack-sb-plugins-common:lint:     The last overload is declared here.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: vite.config.ts:8:41 - error TS2769: No overload matches this call.
@ef-global/backpack-sb-plugins-common:lint:   The last overload gave the following error.
@ef-global/backpack-sb-plugins-common:lint:     Type 'Plugin<any>[]' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:       Type 'Plugin<any>[]' is not assignable to type 'PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:         Type 'Plugin<any>' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:           Type 'Plugin<any>' is not assignable to type 'Plugin_2'.
@ef-global/backpack-sb-plugins-common:lint:             Types of property 'apply' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:               Type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean) |...'.
@ef-global/backpack-sb-plugins-common:lint:                 Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                   Type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
@ef-global/backpack-sb-plugins-common:lint:                     Types of parameters 'config' and 'config' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                       Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig'.
@ef-global/backpack-sb-plugins-common:lint:                         Types of property 'plugins' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                           Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                             Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:                               Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                 Type 'Plugin_2' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                   Type 'Plugin_2' is not assignable to type 'Plugin<any>'.
@ef-global/backpack-sb-plugins-common:lint:                                     Types of property 'apply' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                       Type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean) |...' is not assignable to type '"serve" | "build" | ((this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                         Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                           Type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig, env: import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
@ef-global/backpack-sb-plugins-common:lint:                                             Types of parameters 'config' and 'config' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                               Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").UserConfig'.
@ef-global/backpack-sb-plugins-common:lint:                                                 Types of property 'plugins' are incompatible.
@ef-global/backpack-sb-plugins-common:lint:                                                   Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                     Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption[]'.
@ef-global/backpack-sb-plugins-common:lint:                                                       Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                                         Type 'Promise<false | Plugin<any> | PluginOption[] | null | undefined>' is not assignable to type 'PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:                                                           Type 'Promise<false | Plugin<any> | PluginOption[] | null | undefined>' is not assignable to type 'Promise<false | Plugin_2 | PluginOption[] | null | undefined>'.
@ef-global/backpack-sb-plugins-common:lint:                                                             Type 'false | Plugin<any> | PluginOption[] | null | undefined' is not assignable to type 'false | Plugin_2 | PluginOption[] | null | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                               Type 'Plugin<any>' is not assignable to type 'false | Plugin_2 | PluginOption[] | null | undefined'.
@ef-global/backpack-sb-plugins-common:lint:                                                                 Type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/Users/marckraw/Projects/EF/gc/backpack-sb-plugins-react/packages/common/node_modules/vite/dist/node/index").PluginOption'.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: 8   plugins: [react(), cssInjectedByJs(), ...plugins],
@ef-global/backpack-sb-plugins-common:lint:                                           ~~~~~~~~~~
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint:   node_modules/vite/dist/node/index.d.ts:579:25
@ef-global/backpack-sb-plugins-common:lint:     579 export declare function defineConfig(config: UserConfigExport): UserConfigExport;
@ef-global/backpack-sb-plugins-common:lint:                                 ~~~~~~~~~~~~
@ef-global/backpack-sb-plugins-common:lint:     The last overload is declared here.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: vitest.config.ts:5:3 - error TS2345: Argument of type 'UserConfig & Promise<UserConfig> & (UserConfigFnObject & UserConfigExport)' is not assignable to parameter of type 'never'.
@ef-global/backpack-sb-plugins-common:lint:   Type 'UserConfig & Promise<UserConfig> & UserConfigFnObject' is not assignable to type 'never'.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: 5   viteConfig,
@ef-global/backpack-sb-plugins-common:lint:     ~~~~~~~~~~
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: Found 3 errors in 2 files.
@ef-global/backpack-sb-plugins-common:lint:
@ef-global/backpack-sb-plugins-common:lint: Errors  Files
@ef-global/backpack-sb-plugins-common:lint:      2  vite.config.ts:8
@ef-global/backpack-sb-plugins-common:lint:      1  vitest.config.ts:5
@eunjae-lee
Copy link
Contributor

Hi @marckraw sorry for the late reply. There's a type issue there, and I haven't really found out the cause yet, because to me the type seems correct. You may want to just ignore the warning for the moment.

@Dawntraoz Dawntraoz added help wanted Extra attention is needed dependencies Pull requests that update a dependency file labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants