更新 Vite 后,我无法再启动我的项目,因为我收到以下错误消息:
[vite] Internal server error: This experimental syntax requires enabling one of the following parser plugin(s): "decorators-legacy","decorators"
在更新之前,一切都运行没有问题,而且日志并没有真正帮助我。我在 Vue 中使用 SFC,并为我的组件使用 vue-class-component 和 vue-property-decorator。
我已经更新了:
vite: 2.6.14 -> 2.9.12
@vitejs/plugin-vue: 1.8.0 -> 2.3.3
@vue/compiler-sfc: 3.2.22 -> removed, because it is now a part of plugin-vue
Run Code Online (Sandbox Code Playgroud)
“vite”和“vite build”脚本都会出现此问题。它发现的错误似乎主要发生在组件部分:
// Log
12:55:04 [vite] Internal server error: This experimental syntax requires enabling one of the following parser plugin(s): "decorators-legacy", "decorators". (7:2)
Plugin: vite:vue
File: A:/repositories/private/scribe/src/components/app/ui/tooltip/Tooltip.vue
6 | <div
7 | class="tooltip" …Run Code Online (Sandbox Code Playgroud)