module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

Typing ModuleOptions gives an error

Open silverbackdan opened this issue 1 year ago • 1 comments

I'm working my way through with Typescript and a bit of a newbie but I can't seem to figure out when developing a new Nuxt 3 module why I type a Typscript error in my nuxt.config.ts where I include my module.

export default defineNuxtConfig({
  modules: [
    CwaModule // < -- HERE
  ]
})
Type 'NuxtModule<CwaModuleOptions>' is not assignable to type 'string | NuxtModule<ModuleOptions> | [(string | NuxtModule<ModuleOptions> | undefined)?, ({ [x: string]: any; } | undefined)?] | undefined'

This is the same when starting a brand new module using this builder except I have altered the ModuleOptions interface name for my module

It's quite a simple setup and definition here https://github.com/components-web-app/cwa-nuxt-module/blob/nuxt3/src/module.ts

Is there something I'm missing.. or expected?

silverbackdan avatar Dec 05 '22 15:12 silverbackdan

Are you still experiencing this?

danielroe avatar Apr 25 '24 21:04 danielroe