ngx-timeago
ngx-timeago copied to clipboard
Support for Angular 13
Current behavior
When going from Angular 12 to 13, my tests started showing this error:
Importing TimeagoModule which does not have a ɵmod property
Expected behavior
ngx-timeago should be Ivy compatible.
What is the motivation / use case for changing the behavior?
I'd like to upgrade to Angular 13 but I'm blocked by this.
This package works fine with Angular 13.1.3. When you encounter ...which does not have a ɵmod property
errors, try to delete .angular
cache folder and build again.
Hi @Luke265, thanks for your reply.
It works fine when I run the app, but I encounter that error during tests. Deleting .angular/cache
doesn't help.
● FullscreenImageViewerComponent › should create
Importing TimeagoModule which does not have a ɵmod property
at node_modules/@angular/core/fesm2015/core.mjs:24056:19
at Array.forEach (<anonymous>)
at transitiveScopesFor (node_modules/@angular/core/fesm2015/core.mjs:24053:32)
at setScopeOnDeclaredComponents (node_modules/@angular/core/fesm2015/core.mjs:23995:30)
at flushModuleScopingQueueAsMuchAsPossible (node_modules/@angular/core/fesm2015/core.mjs:23681:21)
at TestBedRender3.checkGlobalCompilationFinished (node_modules/@angular/core/fesm2015/testing.mjs:1816:13)
at TestBedRender3.resetTestingModule (node_modules/@angular/core/fesm2015/testing.mjs:1666:14)
at Function.resetTestingModule (node_modules/@angular/core/fesm2015/testing.mjs:1619:30)
at Function.<anonymous> (../libs/ng-mocks/src/lib/common/ng-mocks-global-overrides.ts:210:21)
at Function.<anonymous> (../libs/ng-mocks/src/lib/mock-helper/mock-helper.faster-install.ts:45:18)
at node_modules/@angular/core/fesm2015/testing.mjs:2000:21
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4250:34)
Any ideas? Thanks!
Might as well try these:
- Delete
.angular
and try to runnpm ci
- Delete
node_modules
and.angular
folders and thennpm i
- Delete
node_modules
and.angular
folder add"postinstall": "ngcc"
topackage.json
scripts and install packagesnpm i
- If you are using another package manager try to switch to
npm
.
My 2 cents on this: running ngcc
after install actually solves the issue for me during tests.
This is not an issue on my side anymore, as I was able to upgrade to Angular 15.