diff --git a/src/utils.ts b/src/utils.ts index cb317fe7..2429907d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -37,8 +37,10 @@ export function tryRequire (id: string, rootDir: string = process.cwd()) { const _require = jiti(rootDir, { interopDefault: true }) try { return _require(id) - } catch (_err) { - console.log(_err.code) - // Ignore + } catch (err: any) { + if (err.code !== 'MODULE_NOT_FOUND') { + console.error(`Error trying import ${id} from ${rootDir}`, err) + } + return {} } }