fix(kit): show correct error when module can't be loaded (#24957)

This commit is contained in:
Peter 2024-01-01 10:14:28 +01:00 committed by GitHub
parent 9dc14c1891
commit d3ea8fed97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
continue
}
}
if (!nuxtModule && error) {
if (typeof nuxtModule !== 'function' && error) {
logger.error(`Error while requiring module \`${nuxtModule}\`: ${error}`)
throw error
}