Error with registerPassKey

I am trying to implement the web3 SFA Passkey feature.

Here are the packages I am using

@web3auth/base”: “8.12.0”,
@web3auth/ethereum-provider”: “8.12.0”,
@web3auth/passkeys-sfa-plugin”: “8.1.0”,
@web3auth/single-factor-auth”: “8.1.0”,

while calling registerPassKey seeing this error

error registering user TypeError: counterBuf.readUInt32BE is not a function
at parseAuthData (passkeysSfaPlugin.esm.js:103:1)
at getPasskeyVerifierId (passkeysSfaPlugin.esm.js:135:1)
at PasskeysPlugin.registerPasskey (passkeysSfaPlugin.esm.js:480:1)
at async web3auth.context.tsx:332:1

ClientID is BObJwerpG_iENrp_cqZ3BMIgPEu9rh38Fw2szO_rTAlKz4JaeAbOazq2WT9CP-07nTQrZDV_8o-2563dLA2Kkxs
Network is SAPPHIRE_DEVNET
Verifier is blok-cognito

OS is IOS

Let me know if you need more information.

Thanks

Hello Gourav,

Thank you for providing the details! Here’s a summary of your issue:

SDK Details:

  • Base: 8.12.0
  • Ethereum Provider: 8.12.0
  • Passkeys SFA Plugin: 8.1.0
  • Single Factor Auth: 8.1.0

Issue:

  • Error while calling registerPassKey: TypeError: counterBuf.readUInt32BE is not a function
    • This error occurs in passkeysSfaPlugin.esm.js lines:
      • parseAuthData: Line 103
      • getPasskeyVerifierId: Line 135
      • registerPasskey: Line 480

Environment:

  • Platform: iOS
  • Network: SAPPHIRE_DEVNET
  • Verifier: blok-cognito

It would be helpful if you could provide:

  • The code snippet you are using for initializing Web3Auth and calling the registerPassKey function.
  • A screenshot of the browser console showing the error, as it might have more insights.

This would help the team in diagnosing the issue more effectively.

This response was generated by the Web3Auth Bot, and a person from the Web3Auth team will review and address your query shortly.

Thanks!

Hey @gourav.paliwal

Can you attempt to replicate it on our demo sfa app? Are you encountering the same error or not?

Also, consider polyfilling the buffer if using on Vite.

Hi @shahbaz , got it working after downgrading the version of base & ethereum-provider packages from 8.12.0 to 8.6.1

@web3auth/base”: “8.6.1”,
@web3auth/ethereum-provider”: “8.6.1”,
@web3auth/passkeys-sfa-plugin”: “8.1.0”,
@web3auth/single-factor-auth”: “8.1.0”,

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

Hey @gourav.paliwal

Please upgrade to v9, it will work in the latest SDK.