Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic type 'ɵɵ*Declaration' requires between x and y type arguments. #232

Open
NathanAlcantara opened this issue Dec 28, 2022 · 8 comments

Comments

@NathanAlcantara
Copy link

Hello, i'm getting this error on Angular 14.2.0 for swal and swalPortal both Component and Directive.

This cause a failure to build. Can you help me? I'm doing wrong?

I'm just install latest versions of ngx-sweetalert2 (12.1.0) and sweetalert2 (11.6.16) and import the module.

Stack:

Error: node_modules/@sweetalert2/ngx-sweetalert2/lib/swal-portal.component.d.ts:11:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 8 type arguments.

11     static ɵcmp: i0.ɵɵComponentDeclaration<SwalPortalComponent, "swal-portal", never, { "template": "template"; }, {}, never, never, false, never>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sweetalert2/ngx-sweetalert2/lib/swal-portal.directive.d.ts:88:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

88     static ɵdir: i0.ɵɵDirectiveDeclaration<SwalPortalDirective, "[swalPortal]", never, { "target": "swalPortal"; }, {}, never, never, false, never>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/@sweetalert2/ngx-sweetalert2/lib/swal.component.d.ts:269:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 8 type arguments.

269     static ɵcmp: i0.ɵɵComponentDeclaration<SwalComponent, "swal", never, { "title": "title"; "titleText": "titleText"; "text": "text"; "html": "html"; "footer": "footer"; "icon": "icon"; "iconColor": "iconColor"; "iconHtml": "iconHtml"; "backdrop": "backdrop"; "toast": "toast"; "target": "target"; "input": "input"; "width": "width"; "padding": "padding"; "background": "background"; "position": "position"; "grow": "grow"; "showClass": "showClass"; "hideClass": "hideClass"; "customClass": "customClass"; "timer": "timer"; "timerProgressBar": "timerProgressBar"; "heightAuto": "heightAuto"; "allowOutsideClick": "allowOutsideClick"; "allowEscapeKey": "allowEscapeKey"; "allowEnterKey": "allowEnterKey"; "stopKeydownPropagation": "stopKeydownPropagation"; "keydownListenerCapture": "keydownListenerCapture"; "showConfirmButton": "showConfirmButton"; "showDenyButton": "showDenyButton"; "showCancelButton": "showCancelButton"; "confirmButtonText": "confirmButtonText"; "denyButtonText": "denyButtonText"; "cancelButtonText": "cancelButtonText"; "confirmButtonColor": "confirmButtonColor"; "denyButtonColor": "denyButtonColor"; "cancelButtonColor": "cancelButtonColor"; "confirmButtonAriaLabel": "confirmButtonAriaLabel"; "denyButtonAriaLabel": "denyButtonAriaLabel"; "cancelButtonAriaLabel": "cancelButtonAriaLabel"; "buttonsStyling": "buttonsStyling"; "reverseButtons": "reverseButtons"; "focusConfirm": "focusConfirm"; "focusDeny": "focusDeny"; "focusCancel": "focusCancel"; "showCloseButton": "showCloseButton"; "closeButtonHtml": "closeButtonHtml"; "closeButtonAriaLabel": "closeButtonAriaLabel"; "loaderHtml": "loaderHtml"; "showLoaderOnConfirm": "showLoaderOnConfirm"; "preConfirm": "preConfirm"; "preDeny": "preDeny"; "imageUrl": "imageUrl"; "imageWidth": "imageWidth"; "imageHeight": "imageHeight"; "imageAlt": "imageAlt"; "inputLabel": "inputLabel"; "inputPlaceholder": "inputPlaceholder"; "inputValue": "inputValue"; "inputOptions": "inputOptions"; "inputAutoTrim": "inputAutoTrim"; "inputAttributes": "inputAttributes"; "inputValidator": "inputValidator"; "returnInputValueOnDeny": "returnInputValueOnDeny"; "validationMessage": "validationMessage"; "progressSteps": "progressSteps"; "currentProgressStep": "currentProgressStep"; "progressStepsDistance": "progressStepsDistance"; "scrollbarPadding": "scrollbarPadding"; "swalOptions": "swalOptions"; "swalFireOnInit": "swalFireOnInit"; "swalDismissOnDestroy": "swalDismissOnDestroy"; "swalVisible": "swalVisible"; }, { "willOpen": "willOpen"; "didOpen": "didOpen"; "didRender": "didRender"; "willClose": "willClose"; "didClose": "didClose"; "didDestroy": "didDestroy"; "confirm": "confirm"; "deny": "deny"; "dismiss": "dismiss"; }, never, never, false, never>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~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iveDeclaration' requires between 6 and 8 type arguments.

106     static ɵdir: i0.ɵɵDirectiveDeclaration<SwalDirective, "[swal]", never, { "swal": "swal"; }, { "confirm": "confirm"; "deny": "deny"; "dismiss": "dismiss"; }, never, never, false, never>;
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Faycop
Copy link

Faycop commented Dec 29, 2022

I'm having the same issue and I have tried every example in the documentation.

@Faycop
Copy link

Faycop commented Dec 29, 2022

I've managed to resolve this by installing the previous release of ngx-sweetalert2:

npm i sweetalert2 @sweetalert2/[email protected]

I still receive this warning at building thogh:

Warning: /.../node_modules/@sweetalert2/ngx-sweetalert2/fesm2015/sweetalert2-ngx-sweetalert2.mjs depends on 'sweetalert2'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

@NathanAlcantara
Copy link
Author

NathanAlcantara commented Dec 30, 2022

I tried the same and worked!
tks @Faycop!

In my package.json i just put ~12.0.2, so the error is in 12.1.0!

About the CommonJS warning there is a closed issue about this: #230 😉

@fsegurai
Copy link

Same issue with ~12.1.0 version

I had to downgrade to ~12.0.2 version and the error stopped appearing.

@fsegurai
Copy link

@limonte can you help us on this one?

@jdelmerie
Copy link

Same issue but it seem like downgrading to 12.0.2 thanks

@vTodorov
Copy link

+1

@fsegurai
Copy link

While using Angular v14, only versions <= 12.0.2 worked, now I'm using Angular v15 and the version 12.1.0 works just fine (haven't encountered any issues so far). I think that the README file needs to be updated specifying the versions we are supposed to use based on the project version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants