Skip to content

Commit

Permalink
fix(builtin): reformat the error message for Node loader.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bweston92 authored and alexeagle committed Aug 28, 2019
1 parent d4686a8 commit 67bca8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/node/node_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,15 @@ module.constructor._resolveFilename = function(request, parent, isMain, options)
}

const error = new Error(
`${TARGET} cannot find module '${request}' required by '${parentFilename}'\n looked in:\n` +
failedResolutions.map(r => ` ${r}`).join('\n') + '\n');
`Cannot find module '${request}'. ` +
'Please verify that the package.json has a valid "main" entry'
);
error.code = 'MODULE_NOT_FOUND';
// todo - error.path = ?;
error.requestPath = parentFilename;
error.bazelTarget = TARGET;
error.failedResolutions = failedResolutions;

throw error;
}

Expand Down

0 comments on commit 67bca8f

Please sign in to comment.