angular icon indicating copy to clipboard operation
angular copied to clipboard

ngx-confetti error type.

Open sebalr opened this issue 1 year ago • 4 comments

Details

ngx-confetti is not working in Angular 15 project using npm.

Error: node_modules/ng-particles/lib/ng-particles.component.d.ts:18:89 - error TS2344: Type '{ options: { alias: "options"; required: false; }; url: { alias: "url"; required: false; }; id: { alias: "id"; required: false; }; particlesInit: { alias: "particlesInit"; required: false; }; }' does not satisfy the constraint '{ [key: string]: string; }'. Property '"options"' is incompatible with index signature. Type '{ alias: "options"; required: false; }' is not assignable to type 'string'. 18 static ɵcmp: i0.ɵɵComponentDeclaration<NgParticlesComponent, "ng-particles", never, { "options": { "alias": "options"; "required": false; }; "url": { "alias": "url"; "required": false; }; "id": { "alias": "id"; "required": false; }; "particlesInit": { "alias": "particlesInit"; "required": false; }; }, { "particlesLoaded": "particlesLoaded"; }, never, never, false, never>;

sebalr avatar Mar 04 '24 23:03 sebalr

Please describe a bit what is the problem with some code samples, and please don't trigger sweep on your own.

matteobruni avatar Mar 05 '24 07:03 matteobruni

Sorry about sweep, I didn't know that it was optional. Theres is an error in node_modules folder in ngx-particles component input declaration. No code sample is needed, just plain Angular 15 projects fails to build with this library installed. I did some research and it looks like that the library is incompatible with Angular 15, I tried with 17 and works. A note on readme with required version would be nice. Thanks

sebalr avatar Mar 05 '24 11:03 sebalr

This is something with angular build, something built with newer angular version is not compatible backwards.

matteobruni avatar Mar 05 '24 12:03 matteobruni

Got it, thanks. It would be nice to have a min compatible version note on readme

sebalr avatar Mar 05 '24 13:03 sebalr