Update from Angular 12 to Angular 13 - Karma Tests are failing

This issue has been created since 2022-11-20.

Which @angular/* package(s) are the source of the bug?

upgrade

Is this a regression?

Yes

Description

After update from Angular 12 to 13 I have this errors:
When I run npm test I get:
Chrome 106.0.0.0 (Windows 10) ERROR: 'JIT compilation failed for injectable', class PlatformLocation { ... }
An error was thrown in afterAll
Uncaught Error: The injectable 'PlatformLocation' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.
The injectable is part of a library that has been partially compiled.
However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.
Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.

In our project we don't have Angular-cli. We use Angular together with Webpack and we have Microfrontends Arhitecure.

So, my question is: In Angular 13, Karma is compatible with stand alone Webpack, to run tests?
If the answer is yes, how can I solve the the error above? (I am looking for a solution that does not require switching to angular cli)

This all the version for my components:
199949895-f46352dc-ebd9-497a-86bd-984b8a98b5fa

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Uncaught Error: The injectable 'PlatformLocation' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.
  The injectable is part of a library that has been partially compiled.
  However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.
  Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
  Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
  or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.3.9
Node: 16.13.2
Package Manager: npm 8.1.2
OS: win32 x64

Angular: 13.3.11
... animations, common, compiler, core, forms, language-service
... localize, platform-browser, platform-browser-dynamic       
... platform-server, router

Package                            Version
------------------------------------------------------------   
@angular-devkit/architect          0.1303.9
@angular-devkit/build-angular      13.3.9
@angular-devkit/core               13.3.9
@angular-devkit/schematics         13.3.9
@angular/cdk                       13.3.9
@angular/material                  13.3.9
@angular/material-moment-adapter   13.3.9
@ngtools/webpack                   13.3.9
@schematics/angular                13.3.9 (cli-only)
rxjs                               7.5.7
typescript                         4.4.4
webpack                            5.74.0

Anything else?

No response

JoostK wrote this answer on 2022-11-20

I'm sorry but custom build configurations are not supported; you'll have to integrate the Angular Linker into your build pipeline.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-12-01
Star Count 85220
Watcher Count 3042
Fork Count 22607
Issue Count 1316

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
feat: Expanded options in auto-pack openings 1 2022-10-30 2022-11-28
Black background and all builds dupe and game gets really laggy 3 2022-10-03 2022-11-16
Support all padding props in contentContainerStyle 0 2022-09-29 2022-11-17
How to use page-ruler-redux. Alt-P does nothing for me 0 2021-02-05 2022-11-25
Feature request: use ligolo without certificates 5 2021-07-28 2022-11-03
Controller detect but no input is recived ingame on linux 8 2021-07-05 2022-11-04
Mouse doesn't hide in controller mode and still moves camera 2 2021-06-28 2022-11-04
More Sponge Types For Extra Sponges 0 2022-03-22 2022-08-01
[Bug]: corruption of logstore task worker accidentally 1 2022-06-11 2022-10-04
Latest Docker image crashes on arm32v7 12 2021-04-11 2022-11-15
Installer for Raspbian? 8 2020-10-15 2022-05-19
[catnip] Missing `Buffer::clone()` Operation for `DPDKBuf` 0 2022-06-08 2022-09-27
False positive for detect-non-literal-fs-filename 9 2019-10-12 2022-12-01
jolt C bindings: Basic functions from JPH::Body class 0 2022-09-09 2022-11-13
Asks for some weird password 13 2016-12-16 2022-09-28
image won't update when search & replace the path of it 1 2022-04-13 2022-11-15
Other Comparison Operators - 1st step instructions unclear 1 2021-10-26 2022-11-21
Close fork when process exits 4 2021-11-10 2022-10-14
Refactor Dataset save methods for consistency 2 2019-08-26 2022-08-04
Make it easy to add items to an experiment 0 2022-05-16 2022-11-18
SDL_GetDisplayName returns empty string for main display device 6 2022-08-10 2022-11-17
Unable to create text column without default value 14 2021-07-08 2022-11-11
Inject node disk load fill experiment, throw Error:pod: in not found, skip to execute command,github.com/chaosblade-io/chaosblade-operator/exec/model.(*ExecCommandInPodExecutor).execCommands.func2" 0 2021-08-30 2022-11-22
Limit bandwidth: which one is correct unit? 1 2021-10-02 2022-11-22
reconsider default gas limit / improve docs for contract related tx's 6 2021-08-31 2022-09-28
Devices with poor acoustic design cause issues by echoing the sound they play to other participants, echo cancellation has to be improved 1 2022-03-10 2022-08-17
renovate-config-validator reports "INFO: Config validated successfully" when no config exists 10 2022-06-12 2022-10-31
SSL Error Handler 1 2021-09-24 2022-01-21
PHP 8.1 support 1 2021-08-08 2022-01-09
Proxy cache list tags from remote works well but pull image failed 7 2022-02-28 2022-11-21
Support for `GROUP BY ALL`/`ORDER BY ALL` 4 2022-01-11 2022-01-12
BlitzAuth plugin onAuth hook 3 2022-06-26 2022-11-30
[Feature Request] Allow slot for table footer (summary) 8 2022-02-06 2022-11-15
Support opaque pointers 0 2022-04-20 2022-11-21
[JWT encoding] JWT claim names `instead of` or `in addition to` their verifiable credential counterparts 22 2022-06-10 2022-11-30
Develop example of tooltip design pattern 40 2022-06-08 2022-11-27
likely wrong code bug from arm64 backend with global isel enabled 13 2022-04-20 2022-09-20
Static Images API doesn't work in Apple M1 1 2021-12-02 2022-11-28
Text rendering artefacts in menus on macOS 1 2022-04-07 2022-09-27
Make an actual 42 release 1 2022-04-08 2022-11-15
Flaky test: Test/StateTransitions_MultipleAddrsEntersReady 5 2021-08-24 2022-11-07
MongoShake是否支持不同Collection发送到不同的Topic呢? 1 2022-09-17 2022-11-23
Support for Pymemcache 10 2021-08-09 2022-11-28
Issues with the App's responsive design 0 2022-06-17 2022-08-06
[rke2] kube-api `additional args` breaks kube api server, cluster is unable to come to active. However, same var on rke1 works as expected 3 2021-11-17 2022-11-21
Bodymovin after effects plugin: Render Failed 2 2022-04-11 2022-11-29
A problem occurred configuring project ':app'. > Cannot change dependencies of dependency configuration ':app:implementation' after it has been included in dependency resolution. 2 2021-03-03 2022-11-05
Change dtoi expiration to 30 days 0 2021-09-30 2022-11-04
tf1.14 tensorboard cannot profile multi batch 3 2021-11-23 2022-11-17
ActiveModel::Type::Date raises for strings longer than 128 characters 0 2022-05-02 2022-11-15