skynet2 / ngx-google-places-autocomplete

Google Places autocomplete for angular web project
MIT License
91 stars 76 forks source link

Importing GooglePlaceModule which does not have a ɵmod property #85

Open marvinfretly opened 3 years ago

marvinfretly commented 3 years ago

Hello, I'm always getting this type of errors when I'm testing components:

Importing GooglePlaceModule which does not have a ɵmod property

      at ../packages/core/src/render3/jit/module.ts:471:13
          at Array.forEach (<anonymous>)
      at transitiveScopesFor (../packages/core/src/render3/jit/module.ts:464:30)
      at ../packages/core/src/render3/jit/module.ts:476:27
          at Array.forEach (<anonymous>)
      at transitiveScopesFor (../packages/core/src/render3/jit/module.ts:464:30)
      at ../packages/core/src/render3/jit/module.ts:476:27
          at Array.forEach (<anonymous>)
      at Object.transitiveScopesFor [as ɵtransitiveScopesFor] (../packages/core/src/render3/jit/module.ts:464:30)
      at getScopeOfModule (../packages/core/testing/src/r3_test_bed_compiler.ts:373:43)
      at ../packages/core/testing/src/r3_test_bed_compiler.ts:379:27
          at Map.forEach (<anonymous>)
      at R3TestBedCompiler.Object.<anonymous>.R3TestBedCompiler.applyTransitiveScopes (../packages/core/testing/src/r3_test_bed_compiler.ts:378:33)
      at R3TestBedCompiler.Object.<anonymous>.R3TestBedCompiler.finalize (../packages/core/testing/src/r3_test_bed_compiler.ts:247:10)
      at TestBedRender3.get (../packages/core/testing/src/r3_test_bed.ts:379:43)
      at TestBedRender3.Object.<anonymous>.TestBedRender3.inject (../packages/core/testing/src/r3_test_bed.ts:278:25)
      at TestBedRender3.Object.<anonymous>.TestBedRender3.createComponent (../packages/core/testing/src/r3_test_bed.ts:334:40)
      at Function.Object.<anonymous>.TestBedRender3.createComponent (../packages/core/testing/src/r3_test_bed.ts:182:33)
      at src/app/modules/tender/summary/summaryActions/summaryActions.component.spec.ts:89:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:386:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:117:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:385:36)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/dist/zone.js:143:47)

My src/app/modules/tender/summary/summaryActions/summaryActions.component.spec.ts:89:23 is: fixture = TestBed.createComponent(TestHostComponent);

I'm getting it even if I'm not using it in this component, just the fact that my app.module is importing GooglePlaceModule make it throw this error.

I'm also getting this error:

Unexpected value 'GooglePlaceModule' imported by the module 'RoadSkillsModule'. Please add an @NgModule annotation.

      at verifySemanticsOfNgModuleDef (../packages/core/src/render3/jit/module.ts:180:13)
      at ../packages/core/src/render3/jit/module.ts:191:5
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../packages/core/src/render3/jit/module.ts:189:58)
      at ../packages/core/src/render3/jit/module.ts:191:5
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../packages/core/src/render3/jit/module.ts:189:58)
      at ../packages/core/src/render3/jit/module.ts:191:5
          at Array.forEach (<anonymous>)
      at verifySemanticsOfNgModuleDef (../packages/core/src/render3/jit/module.ts:189:58)
      at Function.get (../packages/core/src/render3/jit/module.ts:148:13)
      at R3TestBedCompiler.Object.<anonymous>.R3TestBedCompiler.applyProviderOverridesToModule (../packages/core/testing/src/r3_test_bed_compiler.ts:414:49)
      at R3TestBedCompiler.Object.<anonymous>.R3TestBedCompiler.compileTestModule (../packages/core/testing/src/r3_test_bed_compiler.ts:677:10)
      at R3TestBedCompiler.Object.<anonymous>.R3TestBedCompiler.finalize (../packages/core/testing/src/r3_test_bed_compiler.ts:245:10)
      at TestBedRender3.get (../packages/core/testing/src/r3_test_bed.ts:379:43)
      at TestBedRender3.Object.<anonymous>.TestBedRender3.inject (../packages/core/testing/src/r3_test_bed.ts:278:25)
      at Function.Object.<anonymous>.TestBedRender3.inject (../packages/core/testing/src/r3_test_bed.ts:167:33)
      at src/app/modules/tender/summary/summaryActions/summaryActions.component.spec.ts:80:39
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:386:30)
      at AsyncTestZoneSpec.Object.<anonymous>.AsyncTestZoneSpec.onInvoke (node_modules/zone.js/dist/async-test.js:102:47)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:114:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:385:36)
      at Zone.Object.<anonymous>.Zone.runGuarded (node_modules/zone.js/dist/zone.js:154:51)
      at runInTestZone (node_modules/zone.js/dist/async-test.js:224:33)
      at node_modules/zone.js/dist/async-test.js:162:21
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:386:30)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:117:43)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:385:36)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/dist/zone.js:143:47)

For this error my src/app/modules/tender/summary/summaryActions/summaryActions.component.spec.ts:80:39 is:

httpTestingController = TestBed.inject(HttpTestingController);

I don't think that theses errors are coming from me since everything are ok if I remove it from the app.module declaration, and I'm only getting it when testing. Do someone else have the same errors as me ?

egarkavy commented 3 years ago

Yes, I started experiencing the same. Using Jest for running tests. Jest config also contains such setting: transformIgnorePatterns: ["./node_modules/(?!ngx-google-places-autocomplete)"],

marvinfretly commented 3 years ago

In my case I can resolve this issue by removing node_modules and launching "npm ci"