nuxt-modules / ionic

Batteries-included, zero-config Ionic integration for Nuxt
https://ionic.nuxtjs.org
MIT License
385 stars 38 forks source link

Upgrading to typescript 5.5.x breaks plugin helper typing #597

Open Andr9651 opened 3 months ago

Andr9651 commented 3 months ago

🐛 The bug

Adding Typescript@5.5.x to a nuxt/ionic project with helpers exposed via a plugin, results in automatic type information being lost for that plugin. The helper is instead unknown and therefor results in an error when running nuxi typecheck despite it working when running the app.

Steps to reproduce

Open the repro and run npx nuxi typecheck

🛠ī¸ To reproduce

https://stackblitz.com/edit/github-xow1vb?file=plugins%2Ftest.ts

🌈 Expected behaviour

That automatic plugin types work the same as on previous versions of typescript.

Workaround

Manually declare types for plugins as described in the nuxt docs https://nuxt.com/docs/guide/directory-structure/plugins#typing-plugins

ℹī¸ Additional context

As far as I can tell plugin typing still seems to be working for all the other nuxt modules in my project but that might also be because it's manually typed.

jakubkoje commented 2 weeks ago

This is happening to me also. The ionic.d.ts file is empty, and it causes the autoimported plugins to be of type unknown.