Skip to content

Commit

Permalink
feat: print error info when module not found (#427)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Donnalley <mdonnalley@salesforce.com>
  • Loading branch information
CS-Tao and mdonnalley committed Jul 18, 2022
1 parent 48d0334 commit 223e79b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module-loader.ts
Expand Up @@ -87,7 +87,7 @@ export default class ModuleLoader {
return {isESM, module, filePath}
} catch (error: any) {
if (error.code === 'MODULE_NOT_FOUND' || error.code === 'ERR_MODULE_NOT_FOUND') {
throw new ModuleLoadError(`${isESM ? 'import()' : 'require'} failed to load ${filePath || modulePath}`)
throw new ModuleLoadError(`${isESM ? 'import()' : 'require'} failed to load ${filePath || modulePath}: ${error.message}`)
}

throw error
Expand Down

0 comments on commit 223e79b

Please sign in to comment.