-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Module.cwrap is not a function #3
Comments
This solution had the answer. When I added However, now I get the new error:
I think this is being thrown from And I can't find any solution for that. The FAQ suggests that error is from trying to use a C function before the WASM is loaded and initialized, but all the example code for waiting for initialization doesn't work with the browserify bundle.js and/or the web-worker, which seems to disable the I tried a ton of different things, to hold off initializing until the WASM can initialize, but nothing's worked. |
It looks like something in the toolchain that builds bundle.js is creating buggy code. The line:
was throwing a fetch error, so I printed out the value of Once with the value http://localhost:36275/docs/index.wasm, which succeeds, and once with index.wasm, which fails with:
So fetch() is so poorly implemented, it can't understand relative URIs. I'm not sure how to workaround this. I tried hacking it to check for the missing "http://" and prepending If I hard-code it to my current URI, then that error is fixed. I then rewrote worker.js into:
Which required modifying the bottom of chord_detector.js to export Module, so it looks like:
That fixed the remaining However, the detector doesn't work. It doesn't produce any errors but it also doesn't seem to access the detector. Any ideas what I'm doing wrong? |
Seems I spoke too soon. I had commented out some code in demo.js, which I'd forgotten to re-enable and add back to bundle.js. When I re-enabled that, now the detector works. |
Many thanks! I have followed the instructions carefully however, when I go to docs and run a python server, this is the error I'm getting
Any thoughts?
The text was updated successfully, but these errors were encountered: