vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.81k stars 394 forks source link

`declare '#app' {}` not working for `useNuxtApp()` #4568

Closed szulcus closed 2 months ago

szulcus commented 3 months ago

Vue - Official extension or vue-tsc version

2.0.26

VSCode version

1.91.0

Vue version

3.3.13

TypeScript version

4.9.5

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
    Memory: 2.57 GB / 15.88 GB
  Binaries:
    Node: 18.20.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.87)
    Internet Explorer: 11.0.22621.3527

Steps to reproduce

'#app' module with NuxtApp not working but '#app/nuxt' module with NuxtApp working.

It works: image

But it doen't work: image image

Or it: image

What is expected?

Working '#app' module

What is actually happening?

Not working '#app' module

Link to minimal reproduction

https://stackblitz.com/edit/github-fxc8uz?file=index.d.ts

Any additional comments?

No response

minht11 commented 3 months ago

Experiencing the same issue though not using nuxt and just global declare for some internal package in my monorepo.

Last working version for my was vue-tsc 2.0.22. 24 starts failing for me

szulcus commented 3 months ago

@minht11 for me it doesn't work even for vue-tsc@2.0.22 and Vue extension with this version. Generally, since the beginning of Nuxt 3 I have had problems with typing in useNuxtApp, but now I finally managed to find some specifics.

KermanX commented 2 months ago

Thank you for reporting this issue. I think this issue can't be fixed in this repo, as it may happen in any TypeScript Nuxt projects. Please report the issue to Nuxt. Thanks!