问题内容
➜ vite-vue3 npm run dev
> [email protected] dev
> vite
failed to load config from /vite-vue3/vite.config.ts
error when starting dev server:
TypeError: vite.createFilter is not a function
at vueJsxPlugin (/vite-vue3/node_modules/@vitejs/plugin-vue-jsx/dist/index.cjs:47:23)
at Object.<anonymous> (/vite-vue3/vite.config.ts:36:81)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.require.extensions.<computed> [as .ts] (/vite-vue3/node_modules/vite/dist/node/chunks/dep-689425f3.js:62006:20)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at loadConfigFromBundledFile (/vite-vue3/node_modules/vite/dist/node/chunks/dep-689425f3.js:62014:17)
at loadConfigFromFile (/vite-vue3/node_modules/vite/dist/node/chunks/dep-689425f3.js:61933:32)
问题原因
vite插件与vite版本不一致
问题解决
npm install -D vite@^3