[Archive] Got Error: Unable to resolve enough promises

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by ArtemFn on 3/24/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.


Hello!
I’m trying to implement SFA, but get same error “Unable to resolve enough promises.”
at http://localhost:5173/node_modules/.vite/deps/@web3auth_single-factor-auth.js?v=090b000f:32889:20

  1. errors: (5) [undefined, undefined, undefined, undefined, undefined]
  2. predicate: “could not derive private key”
  3. responses: array of 5 responses with results.keys array(with some data)

Basic flow with custom JWT works well with same verifier and chains

What i do:

  1. create verifier for custom JWT(used the same for basic flow)
  2. get instance of Web3AuthSFA(from @web3auth/single-factor-auth) and init
  3. get JWT from my provider(backend for now), parse it to get id field(sub) and call
    web3authSFA.connect({
    verifier: “nb-custom”,
    idToken: accessToken,
    verifierId: decodedJWT.sub,
    });
    when i got error
  • SDK Version: 5.1.0
  • Verifier Details:
    • Verifier Name: nb-custom
    • JWKS Endpoint: https://9b86-91-72-52-210.eu.ngrok.io/.well-known/jwks.json
    • Sample idToken(JWT): eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiJmZDVmZDlhNmRmNzM0NmQ0ODdkNGRmN2U4MTU0ZTI3MCIsInN1YiI6ImFkbWluQGVtYWlsLmNvbSIsIm5iZiI6MTY3OTY3MDc4MiwiZXhwIjoxNjc5NjcxMTQyLCJpYXQiOjE2Nzk2NzA3ODIsImlzcyI6Ik5mdFN5bmNJc3N1ZXIiLCJhdWQiOiJOZnRTeW5jQXVkaWVuY2UifQ.ducChmq1zZF9gxsK-thAXCJmJjcNH8n-ajaSNnEK9algMZjASaEk17MO3SBjOm9q9Szh1WEqX3b3iLBjDI-00JCHhKO7GK6hlfGSkP8HZ9ElTaGhmaGpjVAWStt3T1wZYyRvANaIp8Lr6Rqr1BSNZ5SvfK2VaemIJ9qvX-RcQIz6VT_FLpScQFzZppX6jsEaYUZS9K2lNOOUTzgUUKQ8VVa20bt9v1E5uA9EMTzpSijGJcZC5z6v7ft52YsQzZmhXbQalDJSNc2d3eIpVomAUVkACsTQeV8W7Xmkmdo8VnZpJutmUzscU5wZeBuBqPU1g3eXpbIzhK0NvoF1fHaugw

I am facing this same issue, any help would be appreciate.
Can you provide your jwks? it seems like the url is not responding correctly.

Also

  • Your JWT token header must contain the kid field and the payload data must contain iat field.

The kid field is not present in your jwt header, although I think it is not the error reason.

EDIT: I found that it works when using the example code from the github repo: web3auth-core-kit-examples/single-factor-auth/react-evm-sfa-example/src at main · Web3Auth/web3auth-core-kit-examples · GitHub

The main differences I can see is that we are using vite and a newer version of sfa than the repo

EDIT 2: I downgrade to v4.6.0 but I got the same error.

I’m facing the same error, i tried same code using the node-sdk and there seems to be working. Hope web3auth team will respond to this issues.

JWKs validation works well with this token without SFA

Hey @ArtemFn @erik.zerpa

@bogdanpurnavel was facing a similar issue Single Factor Auth Error - Unable to resolve enough promises - #2 by shahbaz - Single Factor Auth Web SDK - Web3Auth Community

Can you guys confirm this happens only in the Vite app or the above-suggested example app?

If it does, we do have a Vite example app for modal SDK which can be used as a template to test the Vite scenario here.

Hi @shahbaz, yes, it only fails when using vite I tested it without vite using the above example with my custom verifier and it works as expected.

Thanks for confirming @erik.zerpa

Have you tried the Vite example linked above? and adapted it to SFA?

Do you still need assistance?

Do join our upcoming call - Web3Auth Community Call #4 · Zoom · Luma