moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

Ivy Compatibility? #149

Closed leifjones closed 2 years ago

leifjones commented 3 years ago

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior When running ng serve after updating our application to Angular 10 (including the recommended "postinstall" : "ngcc" and updating @ng-idle/keepalive and @ng-idle/core to 10.0.0-beta.1, we see this error in the console:

    ERROR in node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of SettingsModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of CarryModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    src/app/carry/settings/settings.module.ts:106:14 - error NG6002: Appears in the NgModule.imports of CarryModule, but could not be resolved to an NgModule class.

    Is it missing an @NgModule annotation?

    106 export class SettingsModule { }
                     ~~~~~~~~~~~~~~
    node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    src/app/carry/carry.module.ts:63:14 - error NG6002: Appears in the NgModule.imports of AppModule, but itself has errors

    63 export class CarryModule { }
                    ~~~~~~~~~~~

    ERROR in node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of SettingsModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of CarryModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    src/app/my-module/settings/settings.module.ts:106:14 - error NG6002: Appears in the NgModule.imports of CarryModule, but could not be resolved to an NgModule class.

    Is it missing an @NgModule annotation?

    106 export class SettingsModule { }
                     ~~~~~~~~~~~~~~
    node_modules/@ng-idle/keepalive/lib/module.d.ts:2:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

    This likely means that the library (@ng-idle/keepalive) which declares NgIdleKeepaliveModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    2 export declare class NgIdleKeepaliveModule {
                           ~~~~~~~~~~~~~~~~~~~~~
    src/app/my-module/my-module.module.ts:63:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

    Is it missing an @NgModule annotation?

    63 export class CarryModule { }
                    ~~~~~~~~~~~

... and this error in the browser console when attempting to visit localhost:4200 :

core.js:1855 Uncaught Error: Type NgIdleKeepaliveModule does not have 'ɵmod' property.
    at getNgModuleDef (core.js:1855)
    at recurse (core.js:24235)
    at recurse (core.js:24246)
    at registerNgModuleType (core.js:24231)
    at new NgModuleFactory$1 (core.js:24345)
    at compileNgModuleFactory__POST_R3__ (core.js:27894)
    at PlatformRef.bootstrapModule (core.js:28132)
    at Module.zUnb (main.ts:40)
    at __webpack_require__ (bootstrap:79)
    at Object.0 (fund-forecast.ts:16)
getNgModuleDef @ core.js:1855
recurse @ core.js:24235
recurse @ core.js:24246
registerNgModuleType @ core.js:24231
NgModuleFactory$1 @ core.js:24345
compileNgModuleFactory__POST_R3__ @ core.js:27894
bootstrapModule @ core.js:28132
zUnb @ main.ts:40
__webpack_require__ @ bootstrap:79
0 @ fund-forecast.ts:16
__webpack_require__ @ bootstrap:79
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.js:1

Expected behavior Application runs without error when using the Ivy compiler.

Minimal reproduction of the problem with instructions

  1. Upgrade application from 9 to 10 using ng update @angular/core@10 @angular/cli@10
  2. Update core and idle: npm install @ng-idle/core@10.0.0-beta.1 and npm install @ng-idle/keepalive@10.0.0-beta.1
  3. Run application ng serve (Admittedly, I did not pull a demo Angular 9 application to confirm that it doesn't have to do with our implementation.)

What is the motivation / use case for changing the behavior? Whatever the motivations are for the Angular team to use the Ivy compiler ... apparently at least faster compilation

Please tell us about your environment:

Windows 10, VS Code, PowerShell

keygjones commented 3 years ago

Would love this feature, im disabling ivy because of this one

moribvndvs commented 2 years ago

I think when #151 is merged, this will be enabled.

moribvndvs commented 2 years ago

151 has been merged and 11.0.3 has been released.