Skip to content
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

fetch wasm bindings not working in electron/local apps #7

Open
saschTa opened this issue Feb 4, 2018 · 1 comment
Open

fetch wasm bindings not working in electron/local apps #7

saschTa opened this issue Feb 4, 2018 · 1 comment

Comments

@saschTa
Copy link

saschTa commented Feb 4, 2018

When using mam.web.js in electron or any other chromium based local web app, it will fail to load the iota-bindings-emscripten.wasm bindings.
This is caused by the fetch library. It does not support file based URLs like (file://User/...).
see. https://github.com/github/fetch/issues/91

Workaround for retrieving local file should be implemented.

@Core-pl
Copy link

Core-pl commented Feb 4, 2018

iota-bindings-emscripten.wasm has to be sent to browser as mime type of "application/wasm". When you browse from local folder, it is most likely loaded as "text/plain" and throws an issue. I agree, it would be great to have it fixed.

Workaround is to force web server to send it as a proper mime. If you run apache, add .htaccess file to folder where you store .wasm file and add below commands in this file:
<Files "*.wasm">
ForceType application/wasm
< /Files>
***** delete space between < and / in the last row, github did not show properly the tag, so I had to add a space between characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants