From 88d445ddcbc32ad6bc2c9da6cc134b343b8f4bdf Mon Sep 17 00:00:00 2001 From: Travis Hoover Date: Thu, 11 Mar 2021 10:29:54 -0800 Subject: [PATCH] Improve error message when module cannot be found in webpack --- packages/webpack/src/ember-webpack.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/webpack/src/ember-webpack.ts b/packages/webpack/src/ember-webpack.ts index 8eb0ef7c0..0d48bf491 100644 --- a/packages/webpack/src/ember-webpack.ts +++ b/packages/webpack/src/ember-webpack.ts @@ -460,6 +460,8 @@ const Webpack: Packager = class Webpack implements PackagerInstance { error.line = (error.loc ? error.loc.line : null) || (error.location ? error.location.line : null); } if (typeof error.message === 'string') { + error.message = error.message.replace(error.module.context, error.module.userRequest); + // the tmpdir on OSX is horribly long and makes error messages hard to // read. This is doing the same as String.prototype.replaceAll, which node // doesn't have yet.