Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3782ac0

Browse files
committed
fix(kit): handle errors resolving module path
1 parent 63bfaac commit 3782ac0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/kit/src/module/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
7474
const paths = [join(nuxtModule, 'nuxt'), join(nuxtModule, 'module'), nuxtModule]
7575
let error: unknown
7676
for (const path of paths) {
77-
const src = await resolvePath(path)
78-
// Prefer ESM resolution if possible
7977
try {
78+
const src = await resolvePath(path)
79+
// Prefer ESM resolution if possible
8080
nuxtModule = await importModule(src, nuxt.options.modulesDir).catch(() => null) ?? requireModule(src, { paths: nuxt.options.modulesDir })
8181

8282
// nuxt-module-builder generates a module.json with metadata including the version

0 commit comments

Comments
 (0)