cannot allocate wasm memory in CPanel

See original GitHub issue

Environment

  • Operating System: Linux
  • Internal Host System: CPanel
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.12
  • Nitro Version: 0.6.0
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: runtimeConfig, globalName, modules, build, vite, i18n
  • Runtime Modules: @nuxtjs/i18n@8.0.0-beta.1, nuxt-lodash@2.3.0, @pinia/nuxt@0.4.3
  • Build Modules: -

Reproduction

Fresh Nuxt 3 project

Describe the bug

Running the Nuxt server using PM2 always gives a 500-page error and prints this error in logs, Note that the server can run using other tools like CPanel Supervisor

Additional context

No response

Logs

51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)
51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)
51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)
51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)
51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)
51|yarn run start-prod  | [nuxt] [request error] [unhandled] [500] WebAssembly.instantiate(): Out of memory: wasm memory
51|yarn run start-prod  |   at node:internal/deps/cjs-module-lexer/dist/lexer:1:33593
51|yarn run start-prod  |   at async initCJSParse (node:internal/modules/esm/translators:64:5)
51|yarn run start-prod  |   at async ESMLoader.commonjsStrategy (node:internal/modules/esm/translators:156:18)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
devhuscommented, Oct 21, 2022

@danielroe I hope that might help, from a fresh nuxt project hosted on a CPanel VPS

Environment

  • Operating System: Linux
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.12
  • Nitro Version: 0.6.0
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

This project running script exists in ecosystem.config.js nuxt.zip pm2 command: pm2 start ecosystem.config.js

logs

image

0reactions
alfredogotaycommented, Nov 10, 2022

I have been running a node Express app in cPanel for over 6 months without issues but suddenly started getting the same error when trying to load a package (imagemin).

const imagemin = (await import("imagemin")).default // this line throws the error

The error occurs:

  1. when running ‘npm run start’ from cPanel’s terminal
  2. when running as daemon with pm2 process manager

The error does not occur:

  1. when running ‘npm run start’ from a terminal in my PC via SSH

I am running node version 16.6.1

EDIT: I rebooted the server and the error went away

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "out of wasm memory" of next.js app in node.js ...
What I can suggest is to first check if you have any zombie processes or ones allocating a lot of rams and stop...
Read more >
Cannot allocate memory - cPanel Forums
My host says I'm using too many resources. And I see in cPanel for my sites that resources have been limited to use...
Read more >
Chasing Memory Bugs through V8 and WebAssembly
WebAssembly is key to enable critical, CPU-bound tasks on the web, which abound in our OS-like ... Memory(): could not allocate memory.
Read more >
WebAssembly.Memory - MDN Web Docs
The WebAssembly.Memory object is a resizable ArrayBuffer or SharedArrayBuffer that holds the raw bytes of memory accessed by a WebAssembly.
Read more >
RangeError: WebAssembly.instantiate(): Out of memory: wasm ...
Describe the issue/error/question Hello all, I try to install N8N on my server, everything seems to have worked but when I launch N8N...
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