From 0df73c9a2c5d051751f8dcdfc7c4beea8e35096d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brauer?= Date: Wed, 12 Jan 2022 08:37:54 +0000 Subject: [PATCH] fix(webpack): externalize server source-map to prevent RangeError For some reason we see intermittent failures with the source-map-support package (examples: https://github.com/evanw/node-source-map-support/issues/252 and https://github.com/evanw/node-source-map-support/issues/93). The fix that worked for us seems to be to externalize the source-map. Co-authored-by: Markus Wolf --- packages/webpack/lib/configs/node.js | 2 +- packages/webpack/lib/utils/compiler.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webpack/lib/configs/node.js b/packages/webpack/lib/configs/node.js index ef3ec8aa2..cc16a41b5 100644 --- a/packages/webpack/lib/configs/node.js +++ b/packages/webpack/lib/configs/node.js @@ -169,7 +169,7 @@ module.exports = function getConfig(config, name, buildDependencies) { maxEntrypointSize: 52428800, maxAssetSize: 52428800, }, - devtool: 'inline-source-map', + devtool: 'source-map', watchOptions: { aggregateTimeout: 300, ignored: /node_modules/ }, }; }; diff --git a/packages/webpack/lib/utils/compiler.js b/packages/webpack/lib/utils/compiler.js index 468d46d2f..6367f9bd2 100644 --- a/packages/webpack/lib/utils/compiler.js +++ b/packages/webpack/lib/utils/compiler.js @@ -21,7 +21,7 @@ function startCompilation(webpackConfig, options = {}) { const compiler = createCompiler(webpackConfig); const output = join(webpackConfig.output.path, webpackConfig.output.filename); - sourceMapSupport.install({ environment: 'node', hookRequire: true }); + sourceMapSupport.install({ environment: 'node' }); return new Observable((subscriber) => { const callback = (error, stats) => {