Skip to content

ng-hcaptcha error TS2344: Type '{ siteKey: { alias: "siteKey"; required: false; } #63

@dedol1

Description

@dedol1

I get the below error when I add : <ng-hcaptcha (verify)="onVerify($event)" (expired)="onExpired($event)"
(error)="onError($event)">
to my component.html file.

Error: ../node_modules/ng-hcaptcha/lib/ng-hcaptcha-invisible-button.directive.d.ts:39:118 - error TS2344: Type '{ siteKey: { alias: "siteKey"; required: false; }; languageCode: { alias: "languageCode"; required: false; }; }' 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'.

39 static ɵdir: i0.ɵɵDirectiveDeclaration<NgHcaptchaInvisibleButtonDirective, "[ngHcaptchaInvisibleButton]", never, { "siteKey": { "alias": "siteKey"; "required": false; }; "languageCode": { "alias": "languageCode"; "required": false; }; }, { "verify": "verify"; "expired": "expired"; "error": "error"; "click": "click"; }, never, never, false, never>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: ../node_modules/ng-hcaptcha/lib/ng-hcaptcha.component.d.ts:48:87 - error TS2344: Type '{ siteKey: { alias: "siteKey"; required: false; }; theme: { alias: "theme"; required: false; }; size: { alias: "size"; required: false; }; tabIndex: { alias: "tabIndex"; required: false; }; languageCode: { ...; }; }' 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'.

48 static ɵcmp: i0.ɵɵComponentDeclaration<NgHcaptchaComponent, "ng-hcaptcha", never, { "siteKey": { "alias": "siteKey"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "size": { "alias": "size"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "languageCode": { "alias": "languageCode"; "required": false; }; }, { "verify": "verify"; "expired": "expired"; "error": "error"; }, never, never, false, never>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions