State incorrectly typed as any
Hi!
I'm pretty new to Nuxt modules, but I am making some progress.
For my module I want to have a state which tracks the auth state.
I wrote this in
src/runtime/composables/states.ts
:
The state works fine - as in the value is updated correctly - but it is typed as any
instead of Ref<boolean | null>
.
How would I fix this?7 Replies
Can you provide a reproduction? It should be typed correctly like that
Hi,
I have made a simple reproduction, using
nuxi init
as the base for both module and website.
https://github.com/codeman1o1/nuxt-module-mreGitHub
GitHub - codeman1o1/nuxt-module-mre
Contribute to codeman1o1/nuxt-module-mre development by creating an account on GitHub.
The
module/my-module-1.0.0.tgz
is locally built using npm run prepack && npm pack
Hi @manniL / TheAlexLichter (sorry for the ping),
Have you been able to look into this?
It seems like a really strange bug that is not present in the playground, but only in production.
Does this maybe have to do with the build process?not yet ☺️
Might be to do with how the declaration files are rendered by the builder - there is a bug tracking it.
Thanks for your response,
I would like to stay updated on any progress made on this.
Is #233 the issue you mentioned by any chance?
GitHub
Type definitions are incorrect when importing useAsyncData from #im...
Environment Operating System: Darwin Node Version: v20.9.0 Nuxt Version: 3.10.3 CLI Version: 3.10.1 Nitro Version: 2.9.1 Package Manager: [email protected] Builder: - User Config: - Runtime Modules: - B...
GitHub
Plugin injections are unknown · Issue #215 · nuxt/module-builder
Environment Operating System: Darwin Node Version: v20.9.0 Nuxt Version: 3.8.2 CLI Version: 3.10.0 Nitro Version: 2.8.1 Package Manager: [email protected] Builder: - User Config: - Runtime Modules: - Bui...