tsparticles / angular

Angular tsParticles official component
MIT License
31 stars 5 forks source link

ngx-confetti error type. #94

Open sebalr opened 3 months ago

sebalr commented 3 months ago

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>;

matteobruni commented 3 months ago

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

sebalr commented 3 months ago

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

matteobruni commented 3 months ago

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

sebalr commented 3 months ago

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