Closed 2hmad closed 11 months ago
I get TypeError: Failed to execute 'importKey' on 'SubtleCrypto': 2nd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView. error after upgrade my nodejs version from 18.12 to 18.17
TypeError: Failed to execute 'importKey' on 'SubtleCrypto': 2nd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.
18.12
18.17
const JWTService = { verify: async function verify( request: NextRequest, ): Promise<boolean> { const algorithm: JwtAlgorithm = 'ES384' const token = request.cookies.get('token') if (!token) return false return jwt.verify(token.value, atob(String(process.env.JWT_PUBLIC_KEY)), { algorithm }) } }
Are you within a Cloudflare Worker environment?
I get
TypeError: Failed to execute 'importKey' on 'SubtleCrypto': 2nd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.
error after upgrade my nodejs version from18.12
to18.17