diff --git a/packages/kit/src/module/define.ts b/packages/kit/src/module/define.ts index 33ac6d015a..b0f30d80fb 100644 --- a/packages/kit/src/module/define.ts +++ b/packages/kit/src/module/define.ts @@ -65,7 +65,7 @@ function _defineNuxtModule< const optionsDefaults: TOptionsDefaults = module.defaults instanceof Function - ? module.defaults(nuxt) + ? await module.defaults(nuxt) : module.defaults ?? {} let options = defu(inlineOptions, nuxtConfigOptions, optionsDefaults) diff --git a/packages/schema/src/types/module.ts b/packages/schema/src/types/module.ts index 1879678923..532308f5a3 100644 --- a/packages/schema/src/types/module.ts +++ b/packages/schema/src/types/module.ts @@ -64,7 +64,7 @@ export interface ModuleDefinition< TWith extends boolean, > { meta?: ModuleMeta - defaults?: TOptionsDefaults | ((nuxt: Nuxt) => TOptionsDefaults) + defaults?: TOptionsDefaults | ((nuxt: Nuxt) => Awaitable) schema?: TOptions hooks?: Partial setup?: (