diff --git a/packages/kit/src/module/install.ts b/packages/kit/src/module/install.ts index 175620953f..c9bed68728 100644 --- a/packages/kit/src/module/install.ts +++ b/packages/kit/src/module/install.ts @@ -124,6 +124,11 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n } } + // Throw error if module could not be found + if (typeof nuxtModule === 'string') { + throw new TypeError(`Could not load \`${nuxtModule}\`. Is it installed?`) + } + // Throw error if input is not a function if (typeof nuxtModule !== 'function') { throw new TypeError('Nuxt module should be a function: ' + nuxtModule)