Comments (16)
i installed it using yarn add mcl-wasm
. is this correct?
from mcl-wasm.
What browser do you use?
Open
https://herumi.github.io/mcl-wasm/browser/demo.html
and run 'test IBE'. Does it run?
from mcl-wasm.
chrome 95.0.4638.54. yes, it runs.
from mcl-wasm.
but i noticed in that test page, you directly import mcl.js
as a script in your html page. whereas I'd rather import it from within my other javascript files, not directly in the html file.
from mcl-wasm.
Thanks for the information.
When I check import mcl from 'mcl-wasm/';
with React before, it runs well.
I'll check it again for the latest version.
from mcl-wasm.
https://github.com/herumi/misc/tree/master/react/test2 is a tiny sample of mcl-wasm ith React and webpack. It runs well. Could you check it?
import mcl from "mcl-wasm/browser";
from mcl-wasm.
after going to public/
, i get:
this is a test
1234567:894452905640319049678920984443007266612159160327439547902176562641551440349
with no errors in the console. so it looks like it works.
i still don't know what is going wrong on my end, but I can investigate further tomorrow. either way, this test will hopefully help me bootstrap a working setup. thanks for this. hopefully tomorrow i can diagnose and let you know what the issue is.
from mcl-wasm.
FYI, here is my stack trace:
ReferenceError: window is not defined
at Object../node_modules/mcl-wasm/browser/src/index-browser.js (index-browser.js:3)
at __webpack_require__ (bootstrap:24)
at fn (hot module replacement:61)
at Module../src/crypto/worker.js (bn128.js:20)
at __webpack_require__ (bootstrap:24)
at bootstrap:49
at Function.__webpack_require__.O (chunk loaded:23)
at __webpack_require__.x (bootstrap:50)
still working on diagnosing this.
from mcl-wasm.
update: i am able to get this to work in my main (non-worker) scripts. when i try to load mcl
inside a worker, i get the error.
from mcl-wasm.
Could you write the minimum example?
from mcl-wasm.
I invited you to a repo containing a minimal example. can you let me know if you received it and can reproduce?
from mcl-wasm.
Worker has not window but self, so I fixed mcl-wasm to use it.
eda1ff4
cf. https://stackoverflow.com/a/48183681
- Add
resolve: { fallback: { "crypto": false} } ,
towebpack.config.js
. - Use
import mcl from "mcl-wasm/browser";
instead ofimport {mcl} from "mcl-wasm/browser";
.
Then, I think it will run well.
from mcl-wasm.
works. many thanks!
from mcl-wasm.
hello! it seems that somewhere strictly after 0.9.0
but on-or-before 1.0.3
, this issue reverted. can you please confirm whether you are able to reproduce? if not, i can provide an MWE. thanks.
from mcl-wasm.
Thank you for the information.
Please use
import * as mcl from 'mcl-wasm';
instead of
import mcl from "mcl-wasm";
from mcl-wasm.
this appears to work! many thanks as always for the great work.
from mcl-wasm.
Related Issues (20)
- mulVec is not exposed HOT 5
- Beautify mcl_c.js and mcl_c512.js to reduce error size HOT 4
- Checking if a value is on curve? HOT 5
- Expose mclBnFp_mapToG1 and mclBnFp2_mapToG2 HOT 1
- Pairing: check if G1/G2 not in expected subgroup HOT 4
- Can't resolve 'perf_hooks' HOT 12
- Typescript types HOT 5
- index.d.ts isn't published with npm module HOT 4
- Expose G1.mapTo and G2.mapTo
- getStr() incorrect result HOT 1
- run `mcl-wasm` inside SES HOT 38
- Multiply point with scalar value HOT 3
- How to set the vaule of G? HOT 8
- BLS Fr setHashOf HOT 4
- err _wrapInput when trying to invoke setStr HOT 3
- Possible to mod order? HOT 3
- Use with webpack? HOT 8
- Intermittent issue with GT.setStr() HOT 3
- Cannot import scalar values from BLS12-381 Ethereum test suite HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcl-wasm.