Exception raised on call to crypto.subtle.sign in ServiceAccountCredential.sign. Attempting to call createSessionCookie and running the project in local development with a service account. Running on Cloudflare Pages works fine.
Error Message
⨯ Error [TypeError]: Failed to execute 'sign' on 'SubtleCrypto': 3rd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.
at codedTypeError (node:internal/crypto/webidl:45:15)
at makeException (node:internal/crypto/webidl:54:10)
at converters.BufferSource (node:internal/crypto/webidl:218:11)
at SubtleCrypto.sign (node:internal/crypto/webcrypto:848:28)
at ServiceAccountCredential.sign (webpack-internal:///(rsc)/../../node_modules/firebase-auth-cloudflare-workers/dist/module/credential.js:76:53)
...
Details
Strange error. I've verified that the 3rd argument (buf) passed to the sign function is indeed an ArrayBuffer.
Questions
Is this a known issue with the library?
Is it necessary to run the Firebase Auth Emulator for local development? If so, could you please clarify this in the README?
Description
Exception raised on call to
crypto.subtle.sign
inServiceAccountCredential.sign
. Attempting to callcreateSessionCookie
and running the project in local development with a service account. Running on Cloudflare Pages works fine.Error Message
Details
Strange error. I've verified that the 3rd argument (buf) passed to the sign function is indeed an ArrayBuffer.
Questions
Environment
v18.17.1
,v18.20.4
,v20.16.0
Any guidance would be greatly appreciated. Thanks!