Improve frontend error messages written to system log (#17616)

This commit is contained in:
Steve Repsher
2023-08-21 07:01:42 -04:00
committed by GitHub
parent bf912f7bd3
commit 46a036ddbe
7 changed files with 200 additions and 37 deletions

View File

@@ -202,7 +202,10 @@ const createWebpackConfig = ({
!existsSync(info.resourcePath) ||
info.resourcePath.startsWith("./node_modules")
) {
return new URL(info.resourcePath, "webpack://frontend/").href;
// Source URLs are unknown for dependencies, so we use a relative URL with a
// non - existent top directory. This results in a clean source tree in browser
// dev tools, and they stay happy getting 404s with valid requests.
return `/unknown${path.resolve("/", info.resourcePath)}`;
}
return new URL(info.resourcePath, bundle.sourceMapURL()).href;
}