karma tests issue after update to 11.1.0

🐞 bug report

Affected Package

After updating a lot of tests fail with :

x should not create custom style if already created
  Chrome Headless 83.0.4103.0 (Mac OS 10.16.0)
**TypeError: fn.bind is not a function
    at newTrustedFunctionForJIT (http://localhost:9876/_karma_webpack_/vendor.js:15486:15)**
    at JitEvaluator.evaluateCode (http://localhost:9876/_karma_webpack_/vendor.js:15550:29)
    at JitEvaluator.evaluateStatements (http://localhost:9876/_karma_webpack_/vendor.js:15524:21)
    at JitCompiler._interpretOrJit (http://localhost:9876/_karma_webpack_/vendor.js:37651:39)
    at JitCompiler._compileModule (http://localhost:9876/_karma_webpack_/vendor.js:37519:36)
    at http://localhost:9876/_karma_webpack_/vendor.js:37487:39
    at Object.then (http://localhost:9876/_karma_webpack_/vendor.js:11143:52)
    at JitCompiler._compileModuleAndAllComponents (http://localhost:9876/_karma_webpack_/vendor.js:37483:26)
    at JitCompiler.compileModuleAndAllComponentsSync (http://localhost:9876/_karma_webpack_/vendor.js:37440:42)
    at CompilerImpl.compileModuleAndAllComponentsSync (http://localhost:9876/_karma_webpack_/vendor.js:206555:39)

Is this a regression?

yes

Description

after updating about 400/2000 tests are failing with the issue above. The issue exists using chrome rather than chrome headless.

🔬 Minimal Reproduction

not at this time

🔥 Exception or Error


    **TypeError: fn.bind is not a function
        at newTrustedFunctionForJIT (http://localhost:9876/_karma_webpack_/vendor.js:15486:15)**
        at JitEvaluator.evaluateCode (http://localhost:9876/_karma_webpack_/vendor.js:15550:29)
        at JitEvaluator.evaluateStatements (http://localhost:9876/_karma_webpack_/vendor.js:15524:21)
        at JitCompiler._interpretOrJit (http://localhost:9876/_karma_webpack_/vendor.js:37651:39)
        at JitCompiler._compileModule (http://localhost:9876/_karma_webpack_/vendor.js:37519:36)
        at http://localhost:9876/_karma_webpack_/vendor.js:37487:39
        at Object.then (http://localhost:9876/_karma_webpack_/vendor.js:11143:52)
        at JitCompiler._compileModuleAndAllComponents (http://localhost:9876/_karma_webpack_/vendor.js:37483:26)
        at JitCompiler.compileModuleAndAllComponentsSync (http://localhost:9876/_karma_webpack_/vendor.js:37440:42)
        at CompilerImpl.compileModuleAndAllComponentsSync (http://localhost:9876/_karma_webpack_/vendor.js:206555:39)

🌍 Your Environment

Angular Version:

Package Version

@angular-devkit/architect 0.1100.7
@angular-devkit/build-angular 0.1101.0
@angular-devkit/core 11.1.0
@angular-devkit/schematics 11.0.7
@schematics/angular 11.1.0
@schematics/update 0.1101.0
ng-packagr 11.0.3
rxjs 6.6.3
typescript 4.1.3
webpack 4.44.2

"karma": "6.0.1",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.0.3",
"karma-jasmine": "4.0.1",

Anything else relevant?
we use chrome headless vs. chrome but both have the issue. we also have the issue with karma “5.2.3”

4 thoughts on “karma tests issue after update to 11.1.0

  1. @JoostK ok so we are good to go in chrome 87. This was related to chrome 83. Is there somewhere in the docs we can add this as a compatibility. I would be glad to add it ? Otherwise I leave it with you if its worth fixing or supporting 83 👍

  2. Thanks for the chromium info!
    Possible quickfix, in case anybody else stumbles across this who is also not as deeply involved as the guys here:
    I used for example an old puppeteer (3.1.0) and updated it now (5.1.0) which brought a new chromium (88) where fn.bind issue is gone too..

  3. As Joost already mentioned, this exception is thrown due to a known issue with Chrome 83. We’ve intentionally didn’t try to work around the issue because Chrome 83 is over a year old and according to statcounter this version of Chrome had only 0.19%% usage worldwide in December.

    We strongly encourage you to update to a newer version of Chrome (or newer version of puppeteer, which brings in newer version of Chrome). This resolves the problem, and upgrades your testing infrastructure to test against a browser is actually used by users using your app.

    We verified that the issue is no longer present in the browsers supported by Angular, e.g. Chrome 87.

    If you see the problem, please check the version of the browser you are using and keep in mind that puppeteer and certain other testing tools bring in their own version of Chrome, so the version you are using for browsing might be different from that used by your testing tools.

    If for whatever reason, this issue does occur on a supported browser please let us know and we’ll address it quickly.

    We’ll keep on monitoring this issue in case the impact of it is more widespread than what we understand it to be.