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

Electron bundle #67

Open
roccomuso opened this issue Feb 22, 2019 · 0 comments
Open

Electron bundle #67

roccomuso opened this issue Feb 22, 2019 · 0 comments

Comments

@roccomuso
Copy link

I have a bundle like this that is not electron-ready apparently:

const path = require('path').join(__dirname, 'my_project_bg.wasm');
const bytes = require('fs').readFileSync(path);
let imports = {};
imports['./my_project'] = require('./my_project');

const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
module.exports = wasmInstance.exports;

Trying to run it in Electron I get this error:

WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.

Do someone used an app created with create-wasm-app in electron?

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

1 participant