Closed spencer-coti closed 11 months ago
Unable to initialize ZoKrates provider using zokrates-js
package.json:
{ "dependencies": { "zokrates-js": "^1.1.8" } }
test.js (using dynamic import):
const main = async () => { let { initialize } = await import("zokrates-js"); } main()
Output:
globalThis.crypto = webcrypto; ^ TypeError: Cannot set property crypto of #<Object> which has only a getter
test.mjs (notice file extension):
import { initialize } from "zokrates-js"; const main = async () => { console.log('hello') } main()
I was able to solve this by switching to NodeJS v16.16.0
Thanks for reporting this @spencer-coti! Fixed in https://github.com/Zokrates/ZoKrates/pull/1338
Description
Unable to initialize ZoKrates provider using zokrates-js
Environment
Steps to Reproduce
package.json:
test.js (using dynamic import):
Output:
test.mjs (notice file extension):
Output: