import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import viteTsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
viteTsconfigPaths() // <-- ERROR Type 'Plugin_2' is not assignable to type 'PluginOption'.
],
});
extended error:
Type 'Plugin_2' is not assignable to type 'PluginOption'.
Type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").Plugin' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").Plugin'.
Types of property 'apply' are incompatible.
Type '"build" | "serve" | ((this: void, config: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").ConfigEnv) => boolean)' is not assignable to type '"build" | "serve" | ((this: void, config: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").ConfigEnv) => boolean)'.
Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"build" | "serve" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean)'.
Type '(this: void, config: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
Types of parameters 'config' and 'config' are incompatible.
Type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig'.
Types of property 'plugins' are incompatible.
Type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption'.
Type 'Plugin_2' is not assignable to type 'PluginOption'.
Type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").Plugin' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").Plugin'.
Types of property 'apply' are incompatible.
Type '"build" | "serve" | ((this: void, config: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").ConfigEnv) => boolean)' is not assignable to type '"build" | "serve" | ((this: void, config: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").ConfigEnv) => boolean)'.
Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"build" | "serve" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean)'.
Type '(this: void, config: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig, env: import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
Types of parameters 'config' and 'config' are incompatible.
Type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").UserConfig'.
Types of property 'plugins' are incompatible.
Type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption'.
Type 'Promise<false | Plugin_2 | PluginOption[]>' is not assignable to type 'PluginOption'.
Type 'Promise<false | import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").Plugin | import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption[]>' is not assignable to type 'Promise<false | import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").Plugin | import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption[]>'.
Type 'false | import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").Plugin | import("/home/currentuser/dev/my-apps/web_new/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'false | import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").Plugin | import("/home/currentuser/dev/my-apps/web_new/webapp/node_modules/vite/dist/node/index").PluginOption[]'.
Type 'Plugin_2' is not assignable to type 'false | Plugin_2 | PluginOption[]'.ts(2322)
I get an error in vite config when importing this plugin:
versions (in package.json):
vite.config.ts
:extended error: