小编Sau*_*iel的帖子

升级后,Vite/Vue3 抛出内部服务器错误(实验性语法/缺少解析器插件:装饰器)

更新 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)

javascript typescript vue.js vuejs3 vite

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

javascript ×1

typescript ×1

vite ×1

vue.js ×1

vuejs3 ×1