Search code examples
node.jswebassembly

ReferenceError: WebAssembly is not defined


I'm using ttest nodejs module in application. Due to updates to it I tried to use updated version ttest@2.0.0. 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?


Solution

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