Angular 12.2.0 is causing me some trouble. When I try to start it, I keep getting this error:
Generating browser application bundles (phase: sealing).../Users/.../node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:21
const lines = source.match(SPLIT_LINES_REGEX);
^
RangeError: Maximum call stack size exceeded
at String.match (<anonymous>)
at streamChunksOfSourceMapFull (/Users/.../node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:21:23)
at module.exports (/Users/.../node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:389:6)
at SourceMapSource.streamChunks (/Users/.../node_modules/webpack/node_modules/webpack-sources/lib/SourceMapSource.js:211:11)
at module.exports (/Users/.../node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunks.js:13:17)
...
This issue seems quite random as nothing has been changed and rebuilding doesn't always solve it. Sometimes restarting the app brings up the error again.
I tried increasing the maximum call stack size but it didn't help. It feels like a bug because even cleaning cache, deleting node modules, and reinstalling don't guarantee a fix. The problem persists sporadically.
I eventually discovered that the root cause lies in streamChunksOfSourceMap.js
, which Angular uses to create sourcemaps. By setting the sourceMap
property under configurations
in angular.json
to false, the issue disappears, although debugging without sourcemaps is challenging.
Has anyone encountered a similar issue before?