From 76abb53bf144f241781a99caabe813ebfc13dced Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 2 Dec 2024 14:44:24 +0000 Subject: [PATCH] fix(kit): add better logging for non-resolved modules (#30116) --- packages/kit/src/module/install.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/kit/src/module/install.ts b/packages/kit/src/module/install.ts index aa841fa3b7..7b2a6bb29c 100644 --- a/packages/kit/src/module/install.ts +++ b/packages/kit/src/module/install.ts @@ -118,6 +118,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)