verto-health / ngx-turnstile

Cloudflare Turnstile for Angular
https://ngx-turnstile.pages.dev/
MIT License
62 stars 13 forks source link

Getting the following error after installing ngx-trunstile, could you help us on this issue. #19

Closed babupca closed 8 months ago

babupca commented 11 months ago
Error: node_modules/ngx-turnstile/lib/ngx-turnstile.component.d.ts:34:103 - error TS2344: Type '{ siteKey: { alias: "siteKey"; required: false; }; action: { alias: "action"; required: false; }; cData: { alias: "cData"; 
required: false; }; theme: { alias: "theme"; required: false; }; version: { alias: "version"; required: false; }; tabIndex: { ...; }; appearance: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"siteKey"' is incompatible with index signature.
    Type '{ alias: "siteKey"; required: false; }' is not assignable to type 'string'.

34     static ɵcmp: i0.ɵɵComponentDeclaration<NgxTurnstileComponent, "ngx-turnstile", ["ngx-turnstile"], { "siteKey": { "alias": "siteKey"; "required": false; }; "action": { "alias": "action"; "required": false; }; "cData": { "alias": "cData"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "version": { "alias": "version"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; }, { "resolved": "resolved"; }, never, never, false, never>;
                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: src/app/app.component.ts:5:29 - error NG8002: Can't bind to 'siteKey' since it isn't a known property of 'ngx-turnstile'.
1. If 'ngx-turnstile' is an Angular component and it has 'siteKey' input, then verify that it is part of this module.
2. If 'ngx-turnstile' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

5   template: `<ngx-turnstile [siteKey]="siteKey" theme="auto" [tabIndex]="0"></ngx-turnstile>`,
                              ~~~~~~~~~~~~~~~~~~~

Error: Can't resolve 'https://challenges.cloudflare.com/turnstile/v0/api.js' in 'C:\Babu_HP_Laptop\POC\cloudflare\cloudflare'
choyiny commented 9 months ago

Hi there, I'm not able to reproduce this error on my side. Do you have an example we could try with a minimum Angular app? Also, which Angular version are you on?

rbalet commented 9 months ago

Seems to me like you forgot to import the component

choyiny commented 8 months ago

Closing due to inactivity. Feel free to reopen if you are still experiencing this issue!