From d9359b1a299148e0e18d9782465a4471951fae1b Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 14 Dec 2020 18:42:54 +0000 Subject: [PATCH] Update zokrates_js.html After speaking with @dark64, we realised that the import needs to be 'zokrates-js' not 'zokrates-js/node'. I have also included a link to an article on using React with WASM which helps to solve the 'Module parse failed: magic header not detected' error --- toolbox/zokrates_js.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolbox/zokrates_js.html b/toolbox/zokrates_js.html index 6c2e2ff..57f3221 100644 --- a/toolbox/zokrates_js.html +++ b/toolbox/zokrates_js.html @@ -145,10 +145,11 @@

ZoKrates

Note: As this library uses a model where the wasm module itself is natively an ES module, you will need a bundler of some form. Currently the only known bundler known to be fully compatible with zokrates-js is Webpack. The choice of this default was done to reflect the trends of the JS ecosystem.

+

If using the library with React, it may be helpful to reference this post on using WASM with React.

import { initialize } from 'zokrates-js';
 
Node
-
const { initialize } = require('zokrates-js/node');
+
const { initialize } = require('zokrates-js');
 

Example

initialize().then((zokratesProvider) => {