language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

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

Open szulcus opened this issue 1 year ago • 2 comments

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

szulcus avatar Jul 09 '24 08:07 szulcus

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

minht11 avatar Jul 09 '24 09:07 minht11

@minht11 for me it doesn't work even for [email protected] 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.

szulcus avatar Jul 09 '24 11:07 szulcus

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!

kermanx avatar Aug 14 '24 07:08 kermanx