Error using Web Crypto API in wrangler 3.1.0

I'm having trouble with Web Crypto API. The error object thrown is not readable by logging. Anyone else experiencing a similar issue? Any ideas?
DOMException {
stack: undefined,
code: undefined,
name: undefined,
message: undefined
}
DOMException {
stack: undefined,
code: undefined,
name: undefined,
message: undefined
}
2 Replies
James
James2y ago
Can you share a snippet of code that can trigger this?
sz
szOP2y ago
const keyData = 'IZGpRVnehcd1X/eCIbXBkQTTCrT4W6VvCr1wfWqrtZ4='
const data = Uint8Array.from(atob(keyData), (c) => c.charCodeAt(0))
const algorithm = { name: 'AES-GCM' }
crypto.subtle.importKey('raw', data, algorithm, false, [
'encrypt',
'decrypt',
])
const keyData = 'IZGpRVnehcd1X/eCIbXBkQTTCrT4W6VvCr1wfWqrtZ4='
const data = Uint8Array.from(atob(keyData), (c) => c.charCodeAt(0))
const algorithm = { name: 'AES-GCM' }
crypto.subtle.importKey('raw', data, algorithm, false, [
'encrypt',
'decrypt',
])
hmm. i think it was bad key data but not sure. we've recently updated wrangler and i was using the same key data but a fresh one just works fine
Want results from more Discord servers?
Add your server