Skip to content

Commit

Permalink
fix(webpack): externalize server source-map to prevent RangeError
Browse files Browse the repository at this point in the history
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <[email protected]>
  • Loading branch information
ZauberNerd and KnisterPeter committed Jan 12, 2022
1 parent f8b6194 commit 0df73c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/webpack/lib/configs/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/ },
};
};
2 changes: 1 addition & 1 deletion packages/webpack/lib/utils/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 0df73c9

Please sign in to comment.