verto-health/ngx-turnstile

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

Closed this issue · 3 comments

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'

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?

Seems to me like you forgot to import the component

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