Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite cannot detect the components and responsive variables used by Pug when use VueTemplate #19088

Closed
7 tasks done
Lfan-ke opened this issue Dec 28, 2024 · 2 comments
Closed
7 tasks done

Comments

@Lfan-ke
Copy link

Lfan-ke commented Dec 28, 2024

Describe the bug

Depends: npm install -D pug

File: App.vue

<script setup>
import {ref} from "vue";
const val1 = ref(233);
const val2 = ref(233);
import MyComp from "@/components/MyComp.vue";
</script>

<template lang="pug">
#tmp {{ val1 }}
  MyComp
</template>

<style scoped>
#tmp { --tmp: v-bind("val2") }
</style>

Will Be With Error on Build:

> kug@0.0.0 build
> vue-tsc -b && vite build
 error TS6133: 'val1' is declared but its value is never read.
 error TS6133: 'val2' is declared but its value is never read.
 error TS6133: 'MyComp ' is declared but its value is never read.
 Error: Process completed with exit code 2.

Reproduction

https://gitee.com/heke1228/vite-pug-bug.git

Steps to reproduce

npm run build

System Info

File:\WebProjects\kug git:[main]
npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers
Need to install the following packages:
envinfo@7.14.0
Ok to proceed? (y) y


  System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics         
    Memory: 2.24 GB / 15.86 GB
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.63)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @vitejs/plugin-vue: ^5.2.1 => 5.2.1
    vite: ^6.0.3 => 6.0.5

Used Package Manager

npm

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Dec 30, 2024

The error is from vue-tsc not vite. I think you can report there instead.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
@Lfan-ke
Copy link
Author

Lfan-ke commented Dec 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants