Skip to content

<script setup lang="tsx"> 在热更新时抛出错误 #10681

Open
@guaijie

Description

@guaijie

Vue version

3.4.21

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-lsy8bk?file=src%2FApp.vue,src%2Fcomponents%2FHelloWorld.vue,src%2Fcomponents%2Ftypes.ts,package.json&terminal=dev

Steps to reproduce

  1. 定位到 components/types.ts 文件
  2. 打开控制台并清除所有日志
  3. 修改 components/types.ts 中的代码(例如移除 Props 中的 a)
  4. 保存
  5. 热更新失败,控制台打印错误信息
  6. 定位到 components/HelloWorld.vue 文件,随意修改代码保存,热更新成功

image

该问题只出现在 lang="tsx" 的情况,在保存代码进行热更新时抛出错误。

What is expected?

热更新不会抛出错误

What is actually happening?

热更新抛出错误

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions