Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError: WebAssembly is not defined

I'm using ttest nodejs module in application. Due to updates to it I tried to use updated version [email protected]. When module start compute data the error appears:

ReferenceError: WebAssembly is not defined

The NodeJS version - 6.9.1.

Error appears in next place:

class CephesWrapper {
  constructor(sync) {
    // Initialize the runtime's memory
    this._wasmMemory = new WebAssembly.Memory({
      'initial': TOTAL_MEMORY / WASM_PAGE_SIZE,
      'maximum': TOTAL_MEMORY / WASM_PAGE_SIZE
    });
.....
  }
}

Is there any advices about solving this issue? Is it possible to define WebAssembly?

like image 774
Stepan Kovalyshyn Avatar asked May 19 '26 07:05

Stepan Kovalyshyn


2 Answers

The WebAssembly support is added in NodeJs 8.0.0. Update your NodeJS to make it work.

like image 65
Bumsik Kim Avatar answered May 23 '26 04:05

Bumsik Kim


In my case, the problem was that I was running my browser in safe mode (Mozilla Firefox). Simply shutdown your browser completely and restart. This will quit safe mode (If stuck in safe mode, see here)

For reference, I had found this solution here : https://github.com/mozilla-iot/gateway/issues/2047

like image 40
EmirDev Avatar answered May 23 '26 05:05

EmirDev