admin管理员组

文章数量:1295302

I'm using Angular x-image-viewer to view images. After updating from Angular 16 to Angular 19, I encountered this error. I'm not sure if it's related to Angular 19, as I got the same error in Angular 17.

Full error message:

Error: src/app/app.module.ts:149:5 - error NG6002: 'AngularImageViewerModule' does not appear to be an NgModule class.

149     AngularImageViewerModule
        ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/angular-x-image-viewer/lib/angular-image-viewer.module.d.ts:1:22
    1 export declare class AngularImageViewerModule {
                           ~~~~~~~~~~~~~~~~~~~~~~~~
    This likely means that the library (angular-x-image-viewer) which declares AngularImageViewerModule 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.

I tried to find a replacement for this library, but I couldn't find anything that works with Angular 19. I also tried adding

"postinstall": "ngcc",

to package.json but it didn’t resolve the issue.

本文标签: angularerror NG6002 39AngularImageViewerModule39 does not appear to be an NgModule classStack Overflow