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

vue-tsc cannot detect the components and responsive variables used by pug when use vite with vue-template #5108

Open
Lfan-ke opened this issue Jan 4, 2025 · 1 comment
Labels
question Further information is requested

Comments

@Lfan-ke
Copy link

Lfan-ke commented Jan 4, 2025

Vue - Official extension or vue-tsc version

tsc-verison: 2.1.10

VSCode version

null

Vue version

3.5.13

TypeScript version

5.6.3

System Info

File:\WebProjects\kug git:[main]
npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers
Need to install the following packages:
[email protected]
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

package.json dependencies

{
  "dependencies": {
    "pinia": "^2.3.0",
    "vue": "^3.5.13"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^5.2.1",
    "@vue/tsconfig": "^0.7.0",
    "less": "^4.2.1",
    "pug": "^3.0.3",
    "typescript": "~5.6.2",
    "vite": "^6.0.3",
    "vue-tsc": "^2.1.10"
  }
}

Steps to reproduce

more please see: vitejs/vite#19088
there is an public gitee example at here

[email protected] 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.

What is expected?

i hope vue-tsc can detected tsvariable used in pug(eg: div#xxx(:data-type="var1") {{ var2 }}) and css(eg: v-bind('xxx'))

What is actually happening?

more please see: vitejs/vite#19088
there is an public gitee example at here

VSCode, WebStorm and HBuildX will hint red line of the variable will never used
npm run dev will success but npm run build (used tsc) will error
i must config ```
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true


### Link to minimal reproduction

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

### Any additional comments?

_No response_
@KazariEX
Copy link
Collaborator

KazariEX commented Jan 5, 2025

@KazariEX KazariEX added question Further information is requested and removed pending triage labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants