Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error while using get #84

Open
bharath154 opened this issue Mar 18, 2024 · 2 comments
Open

Compilation error while using get #84

bharath154 opened this issue Mar 18, 2024 · 2 comments

Comments

@bharath154
Copy link

Hello,

I am running into this compilation error, while trying to use navigate.credentials.get. Is this an issue or I am missing something?

 tsc --noEmit
node_modules/@github/webauthn-json/src/webauthn-json/base64url.ts:28:26 - error TS2569: Type 'Uint8Array' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.

28   for (const charCode of byteView) {
                            ~~~~~~~~


Found 1 error.

tsc --version
Version 4.5.5

I am using it as below in my ts project:

      const options = parseRequestOptionsFromJSON({
        publicKey: {
          challenge: securityKeyChallengeResponse.challenge,
          timeout: 60000,
          rpId: securityKeyChallengeResponse.rp.id,
          allowCredentials: securityKeyChallengeResponse.allowedCredentials,
        },
      });

      const securityKeyCredential = await get(options);
      const securityKeyCredentialJson = securityKeyCredential.toJSON();

@lgarron
Copy link
Contributor

lgarron commented Mar 19, 2024

I'd suggest making sure that:

  • your version of TypeScript is more up to date (TypeScript 4.5.5 is over 2 years old), and
  • targetting "es2015" or higher.

(I can't offer useful advice for targeting anything other than ESM.)

@bharath154
Copy link
Author

Cool. Thanks. For now will live with a patch to this file. Once we do upgrade we may not need this patch. Thanks for your help! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants