Custom webpack configuration for angular karma tests not resolving Components but works for Directives

452 Views Asked by At

I made custom webpack config for angular karma and when starting tests, getting this message for each test with @Component decorator:

TypeError: Cannot read property 'ɵcmp' of undefined at getComponentDef (http://localhost:9876/karma_webpack/main.js:71825:14)

enter image description here

Tests with @Directives working without errors.

I'm adding for angular build in custom webpack config following plugin and rule with disabled aot(jitMode=true): enter image description here

Package versions:

  • webpack 5.36.2
  • @ngtools/webpack 11.2.11

has anyone faced such a problem?

0

There are 0 best solutions below