question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI error: abort(RangeError: WebAssembly.instantiate(): Out of memory: wasm memory)

See original GitHub issue

Describe the bug

For whatever command and image I run through cli, I always get

- (node:41120) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 25 unpipe listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:41120) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 25 error listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:41120) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 25 close listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:41120) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 25 finish listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
0/1 \ ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (24 threads)
 text-split.png: 462.15KBfailed to asynchronously prepare wasm: RangeError: WebAssembly.instantiate(): Out of memory: wasm memory
node:internal/process/promises:227
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "abort(RangeError: WebAssembly.instantiate(): Out of memory: wasm memory). Build with -s ASSERTIONS=1 for more info.".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Version:

  • OS w/ version: Windows 10 and WSL 1 Ubuntu 18.04
  • Node version: 15.6.0
  • npm version: 7.4.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:11
  • Comments:8

github_iconTop GitHub Comments

3reactions
johnnyreillycommented, Dec 29, 2021

I also encounter this on Ubuntu 20. A little more context; I was using https://github.com/webpack-contrib/image-minimizer-webpack-plugin with these options:

const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");

module.exports = {
  module: {
    rules: [
      // You need this, if you are using `import file from "file.ext"`, for `new URL(...)` syntax you don't need it
      {
        test: /\.(jpe?g|png)$/i,
        type: "asset",
      },
    ],
  },
  optimization: {
    minimizer: [
      new ImageMinimizerPlugin({
        minimizer: {
          implementation: ImageMinimizerPlugin.squooshMinify,
          options: {
            encodeOptions: {
              mozjpeg: {
                // That setting might be close to lossless, but it’s not guaranteed
                // https://github.com/GoogleChromeLabs/squoosh/issues/85
                quality: 100,
              },
              webp: {
                lossless: 1,
              },
              avif: {
                // https://github.com/GoogleChromeLabs/squoosh/blob/dev/codecs/avif/enc/README.md
                cqLevel: 0,
              },
            },
          },
        },
      }),
    ],
  },
};

The error encountered was:

failed to asynchronously prepare wasm: RangeError: WebAssembly.instantiate(): Out of memory: wasm memory
failed to asynchronously prepare wasm: RangeError: WebAssembly.instantiate(): Out of memory: wasm memory

node:internal/event_target:777
  process.nextTick(() => { throw err; });
                           ^
Error [RuntimeError]: abort(RangeError: WebAssembly.instantiate(): Out of memory: wasm memory). Build with -s ASSERTIONS=1 for more info.
    at abort (/home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/@squoosh/lib/build/index.js:28:9428)
    at /home/john/code/github/blog.johnnyreilly.com/blog-website/node_modules/@squoosh/lib/build/index.js:28:11293
Emitted 'error' event on Worker instance at:
1reaction
JalinWangcommented, Jul 6, 2022

Do these warnings matter?

Win10 21H1 node v14.18.0

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - RangeError: WebAssembly.instantiate(): Out of memory
I am getting this error while starting my node js app in my cpanel. RangeError: WebAssembly.instantiate(): Out of memory: wasm memory at ...
Read more >
RangeError: WebAssembly.instantiate(): Out of memory: wasm ...
The error message suggests there is not enough memory available to execute the WebAssembly.instantiate() function (which seems to come from the ...
Read more >
Chasing Memory Bugs through V8 and WebAssembly
[Error RangeError: WebAssembly.instantiate(): Out of memory: wasm memory]. This was a bit surprising, since we have relatively beefy ...
Read more >
WebAssembly System Interface (WASI) | Node.js v19.3.0 ...
start() requires that instance exports a WebAssembly.Memory named memory . If instance does not have a memory export an exception is thrown. If...
Read more >
Help me with WebAssembly.Instance(): Out of memory
I use cpanel, and when I try to build the project, I have this error: RangeError: WebAssembly.Instance(): Out of memory: wasm memory at ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found