Skip to content

when use <script lang="tsx" setup> with template. HMR can not resolve import component using in template #22

@we125182

Description

@we125182

Describe the bug

after project run. replace App.vue<script>code with follows

<script setup lang="tsx">
import { Search } from '@element-plus/icons-vue'
// import { Apple } from '@element-plus/icons-vue'

import RenderComp from './components/RenderComp'

const label = () => (<div>test</div>)
</script>

<template>
  <RenderComp :label="label" />
  <Search />
  <!-- <Apple /> -->
</template>

warning
only after the project running, import new component using in template. the problem appears.

Reproduction

https://stackblitz.com/edit/vitejs-vite-qrc4zw?file=src/App.vue

System Info

System:
    OS: macOS 11.6.5
    CPU: (8) x64 Apple M1
    Memory: 31.31 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - /usr/local/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 95.0
    Safari: 15.4
  npmPackages:
    @vitejs/plugin-vue: ^2.3.3 => 2.3.3 
    @vitejs/plugin-vue-jsx: ^1.3.10 => 1.3.10 
    vite: ^2.9.12 => 2.9.12

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: hmrp3-minor-bug 🔨An edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions