richnologies/ngx-stripe

[BUG] Insert ngx-stripe into the .module show error

4i-helpynet opened this issue · 1 comments

Describe the bug
A clear and concise description of what the bug is.
After adding ngx-stripe into the module.ts with working test key - but not add to the component, I get this error:

Error: node_modules/ngx-stripe/lib/components/address.component.d.ts:41:97 - error TS2344: Type '{ containerClass: { alias: "containerClass"; required: false; }; options: { alias: "options"; required: false; }; elementsOptions: { alias: "elementsOptions"; required: false; }; stripe: { alias: "stripe"; required: false; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
Property '"containerClass"' is incompatible with index signature.
Type '{ alias: "containerClass"; required: false; }' is not assignable to type 'string'.

41 static ɵcmp: i0.ɵɵComponentDeclaration<StripeAddressComponent, "ngx-stripe-address", never, { "containerClass": { "alias": "containerClass"; "required": false; }; "options": { "alias": "options"; "required": false; }; "elementsOptions": { "alias": "elementsOptions"; "required": false; }; "stripe": { "alias": "stripe"; "required": false; }; }, { "load": "load"; "blur": "blur"; "change": "change"; "focus": "focus"; "ready": "ready"; "escape": "escape"; "loaderror": "loaderror"; "loaderstart": "loaderstart"; }, ["loadingTemplate"], never, true, never>;

To Reproduce
Steps to reproduce the behavior:

  1. create new application (ng version:
    Angular CLI: 15.0.5
    Node: 16.17.1
    Package Manager: npm 8.15.0
    OS: win32 x64

Angular: 15.2.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1502.8
@angular-devkit/build-angular 15.2.8
@angular-devkit/core 15.2.8
@angular-devkit/schematics 15.0.5
@angular/cli 15.0.5
@schematics/angular 15.0.5
rxjs 7.5.7
typescript 4.8.4

2: install ngx-stripe, @stripe/stripe.js
3 add ngx-stripe to the app.model.ts
4 run ng serve --hmr

I have same issue.

Is your ngx-stripe major version matching angular major version?

If you're using Angular 15 for example, you should install ngx-stripe version 15.

Also, can I see a snippet on what are you trying to do with the library?