next.js: "RangeError: WebAssembly.instantiate(): Out of memory: wasm memory" when using environment with limited virtual memory

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

/app # npx next info

    Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Thu May 25 07:17:40 UTC 2023
    Binaries:
      Node: 16.20.0
      npm: 8.19.4
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.3.3
      eslint-config-next: 13.4.2
      react: 18.2.0
      react-dom: 18.2.0

/app # ulimit -a 
core file size (blocks)         (-c) 0
data seg size (kb)              (-d) unlimited
scheduling priority             (-e) 0
file size (blocks)              (-f) unlimited
pending signals                 (-i) 63574
max locked memory (kb)          (-l) 82000
max memory size (kb)            (-m) 2048000
open files                      (-n) 1048576
POSIX message queues (bytes)    (-q) 819200
real-time priority              (-r) 0
stack size (kb)                 (-s) 8192
cpu time (seconds)              (-t) unlimited
max user processes              (-u) unlimited
virtual memory (kb)             (-v) 2048000
file locks                      (-x) unlimited

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/IoanStoianov/limited-virtual-memory-nextjs/tree/main

To Reproduce

Clone the limited-virtual-memory-nextjs and follow the Readme

Local:

  1. Limit the virtual memory of your environment. I tried it on docker image node:16.20.0-alpine - ulimit -v 2048000
  2. Install version higher than 13.3.3
  3. Run npx next info
  4. Get: RangeError: WebAssembly.instantiate(): Out of memory: wasm memory    at lazyllhttp (node_modules/next/dist/compiled/undici/index.js:1:55249)

Describe the Bug

This behavior happens when I upgrade to a version higher than 13.3.3. I cannot run even npx next info

Expected Behavior

To be able to perform next commands on environment with limited virtual memory

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

I deployed the app on my client’s cPanel

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 5
  • Comments: 16

Most upvoted comments

Getting the same issue with cPanel

downgraded to v12? then it wont use the app router and other next features. in that case Next Js is useless to me.