webauthn-json
webauthn-json copied to clipboard
Compilation error while using get
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();
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.)
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! 🙇
Closing as this project has been deprecated. Please see the project readme for more information.