ng2-pdf-viewer icon indicating copy to clipboard operation
ng2-pdf-viewer copied to clipboard

Getting Error after install this package

Open padfoot044 opened this issue 1 year ago • 17 comments

Generic type 'ɵɵComponentDeclaration' requires between 7 and 9 type arguments

Error: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:95:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 9 type arguments.

95 static ɵcmp: i0.ɵɵComponentDeclaration<PdfViewerComponent, "pdf-viewer", never, { "src": { "alias": "src"; "required": false; }; "cMapsUrl": { "alias": "c-maps-url"; "required": false; }; "page": { "alias": "page"; "required": false; }; "renderText": { "alias": "render-text"; "required": false; }; "renderTextMode": { "alias": "render-text-mode"; "required": false; }; "originalSize": { "alias": "original-size"; "required": false; }; "showAll": { "alias": "show-all"; "required": false; }; "stickToPage": { "alias": "stick-to-page"; "required": false; }; "zoom": { "alias": "zoom"; "required": false; }; "zoomScale": { "alias": "zoom-scale"; "required": false; }; "rotation": { "alias": "rotation"; "required": false; }; "externalLinkTarget": { "alias": "external-link-target"; "required": false; }; "autoresize": { "alias": "autoresize"; "required": false; }; "fitToPage": { "alias": "fit-to-page"; "required": false; }; "showBorders": { "alias": "show-borders"; "required": false; }; }, { "afterLoadComplete": "after-load-complete"; "pageRendered": "page-rendered"; "pageInitialized": "pages-initialized"; "textLayerRendered": "text-layer-rendered"; "onError": "error"; "onProgress": "on-progress"; "pageChange": "pageChange"; }, never, never, false, never, false>;

That's all details, and I am getting this error after I install package and Import in module file

image

padfoot044 avatar Sep 12 '23 14:09 padfoot044

What version of Angular are you using? e.g. https://stackoverflow.com/questions/72701446/error-ts2314-generic-type-%C9%B5%C9%B5componentdeclaration-requires-7-type-arguments

shamoon avatar Sep 12 '23 16:09 shamoon

I am using angular version 16 and do we need fontAwesome for this package?

padfoot044 avatar Sep 13 '23 06:09 padfoot044

Ha, no I dont mean you need fontawesome just that the error has come up in other projects due to angular version mismatch. Im using the plugin in v16 without any issues. A few of the SO threads seem to indicate an issue with the angular version not being updated https://stackoverflow.com/questions/74616687/error-ts2707-generic-type-%C9%B5%C9%B5directivedeclaration-requires-between-6-and-8-type https://stackoverflow.com/questions/73024384/how-can-i-fix-error-ts2314-generic-type-%C9%B5%C9%B5directivedeclaration-requires-6-typ but not sure, just trying to help

shamoon avatar Sep 13 '23 06:09 shamoon

node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts:95:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 9 type arguments.

image

Maybe It will help

padfoot044 avatar Sep 13 '23 11:09 padfoot044

I am encountering the same issue with ng version 15

hreward avatar Sep 20 '23 09:09 hreward

Yeap ,these issue are popping in Angular 15 and as well as 16 too. I think the pdf viewer need some adjustments with latest frameworks and typescript

ammad172 avatar Sep 28 '23 07:09 ammad172

Hi guys, any update on this I am facing the same issue.

alexJPL avatar Oct 04 '23 17:10 alexJPL

same with angular 16

TheNemus avatar Oct 05 '23 13:10 TheNemus

Same issue with angular 15. Anyone figure out a way around it?

pgingras avatar Oct 19 '23 14:10 pgingras

facing same problem with angular 16

SandeepBanerjee avatar Oct 28 '23 14:10 SandeepBanerjee

Same issue I am facing image How can I resolve It for angular 15.2.9?

pranaypalaskar22 avatar Nov 08 '23 14:11 pranaypalaskar22

Same here, but using Angular v12

gcamara avatar Nov 15 '23 19:11 gcamara

Same here, using Angular v14

oldjazjef avatar Nov 16 '23 13:11 oldjazjef

pegging the version to this helped me. I just migrated my app to Angular 15 from 14.

{
...
    "ng2-pdf-viewer": "9.1.5",
...
}

reinaH avatar Nov 18 '23 01:11 reinaH

Si, al cambiar la version de la librería funciona correctamente.

NicolasCasanovaVasquez avatar Nov 19 '23 16:11 NicolasCasanovaVasquez

Si, al cambiar la version de la librería funciona correctamente.

bkn :)

reinaH avatar Nov 20 '23 02:11 reinaH

Desinstale mi versión actual la cual era la 10.0.0 e instale la versión 9.1.5 Y se soluciono el problema.

Aurich17 avatar Mar 20 '24 16:03 Aurich17