nuxt / module-builder

Complete solution to build and ship Nuxt modules.
MIT License
211 stars 22 forks source link

Type 'NuxtModule<ModuleOptions>' is not assignable to type 'string | false | NuxtModule<ModuleOptions> | ... #281

Open markbrockhoff opened 2 weeks ago

markbrockhoff commented 2 weeks ago

Hi,

after using this template to kickstart my module I encountered a strange type issue inside the nuxt config of the test fixture:

image

It looks like somehow the types exported from the module differ from the ones actually defined. The problem only occurs once something is added to the ModuleOptions interface, as long as it's empty there is no issue. Maybe this issue is related to #223.

I created a very minimal reproduction here: https://github.com/markbrockhoff/nuxt-module-template-bug-repro To reproduce the issue just clone the repo, install the dependencies using pnpm and run pnpm dev:prepare to generate the types. Afterwards open the file test/fixture/build/nuxt.config.ts or run pnpm test:types to see the type conflict.

Any help on this would be appreciated.