ngx-timeago icon indicating copy to clipboard operation
ngx-timeago copied to clipboard

Support for Angular 13

Open siovene opened this issue 2 years ago • 4 comments

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.

siovene avatar Dec 25 '21 19:12 siovene

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.

Luke265 avatar Jan 23 '22 20:01 Luke265

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!

siovene avatar Jan 24 '22 14:01 siovene

Might as well try these:

  • Delete .angular and try to run npm ci
  • Delete node_modules and .angular folders and then npm i
  • Delete node_modules and .angular folder add "postinstall": "ngcc" to package.json scripts and install packages npm i
  • If you are using another package manager try to switch to npm.

Luke265 avatar Jan 24 '22 16:01 Luke265

My 2 cents on this: running ngcc after install actually solves the issue for me during tests.

GerkinDev avatar Feb 14 '22 14:02 GerkinDev

This is not an issue on my side anymore, as I was able to upgrade to Angular 15.

siovene avatar Dec 05 '22 16:12 siovene