'Error Unit testing Angular 8 / Jasmine / Karma : RangeError: Maximum call stack size exceeded
I'm using Jasmine to unit test my angular app and sometimes this error below occurs in the Karma window. I can't find where it could come from since it happens about 1/5 times on reloading. It happens when in watch mode. Any clue?
zone.js:202 Uncaught RangeError: Maximum call stack size exceeded
at RegExp.exec (<anonymous>)
at Array.<anonymous> (VM2578 browser-source-map-support.js:110)
at VM2578 browser-source-map-support.js:102
at d (VM2578 browser-source-map-support.js:103)
at q (VM2578 browser-source-map-support.js:106)
at VM2578 browser-source-map-support.js:107
at Array.map (<anonymous>)
at Function.w [as prepareStackTrace] (VM2578 browser-source-map-support.js:107)
at VM2580 jasmine.js:897
at onerror (VM2580 jasmine.js:3199)
Most of the time, after reloading the karma window once, the test sets run again and it works.
Solution 1:[1]
Using the option ng test --source-map=false prevents the error from happening, but isnt a permanent solution since it obviously just disables source maps and makes stack traces useless.
Using this option in ci prevents the tests from failing though.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jeremias Nater |
