fix(kit): module compatibility not working with module names

This commit is contained in:
Harlan Wilton 2023-07-06 12:36:49 +10:00
parent 88f914e9a0
commit 6cabe69ce0

View File

@ -46,7 +46,7 @@ export async function getNuxtModuleVersion (module: string | NuxtModule, nuxt: N
return version return version
} }
// it's possible that the module will be installed, it just hasn't been done yet, preemptively load the instance // it's possible that the module will be installed, it just hasn't been done yet, preemptively load the instance
if (typeof module !== 'string' && nuxt.options.modules.includes(moduleMeta.name)) { if (nuxt.options.modules.includes(moduleMeta.name)) {
const { buildTimeModuleMeta } = await loadNuxtModuleInstance(moduleMeta.name, nuxt) const { buildTimeModuleMeta } = await loadNuxtModuleInstance(moduleMeta.name, nuxt)
return buildTimeModuleMeta.version || false return buildTimeModuleMeta.version || false
} }