Skip to content

vite-ts 模板:dev:mp-weixin 编译时报错 ERROR: Expected ">" but found "setup" 且无法热更新 #102

@DengSihan

Description

@DengSihan

issue:

  1. dev:mp-wieixn 编译错误
  2. dev:mp-wieixn 无法实现在微信开发者工具中热更新

reproduction:

  1. npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project
  2. cd my-vue3-project && npm run install
  3. npm run dev:mp-weixin
  4. 修改 src/pages/index/index.vue 的任意内容

[plugin:commonjs] Transform failed with 1 error:
PROJECT_DIR/src/App.vue?vue&type=script&setup=true&lang.ts:1:8: ERROR: Expected ">" but found "setup"
at App.vue:1:8

Expected ">" but found "setup"
1 | <script setup lang="ts">
| ^
2 | import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
3 | onLaunch(() => {

ENV:node v20.12.0 win10


在修改了 src/pages/index/index.vue 中的内容后,dist/dev/mp-weixin 中的对应内容并没有更新

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions