Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RangeError: WebAssembly.Instance(): Out of memory: wasm memory

When compiling assets using Laravel Mix, I am getting the below error.

Steps I followed:

  1. Clone Laravel Git
  2. Install all node_modules using npm install
  3. Getting error when compiling assets using (npx mix or npm run dev/prod)

I have already tried reinstalling and different versions of node and npm but still getting the same error.

[webpack-cli] RangeError: WebAssembly.Instance(): Out of memory: wasm memory at create (/home/my_app/public_html/app/laravel/node_modules/webpack/lib/util/hash/wasm-hash.js:154:4) at module.exports (/home/my_app/public_html/app/laravel/node_modules/webpack/lib/util/createHash.js:152:27) at /home/my_app/public_html/app/laravel/node_modules/webpack/lib/DefinePlugin.js:289:22 at Hook.eval [as call] (eval at create (/home/my_app/public_html/app/laravel/node_modules/tapable/lib/HookCodeFactory.js:1:1), :194:1) at Hook.CALL_DELEGATE [as _call] (/home/my_app/public_html/app/laravel/node_modules/tapable/lib/Hook.js:14:14) at Compiler.newCompilation (/home/my_app/public_html/app/laravel/node_modules/webpack/lib/Compiler.js:1053:26) at /home/my_app/public_html/app/laravel/node_modules/webpack/lib/Compiler.js:1097:29 at Hook.eval [as callAsync] (eval at create (/home/my_app/public_html/app/laravel/node_modules/tapable/lib/HookCodeFactory.js:1:1), :22:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/my_app/public_html/app/laravel/node_modules/tapable/lib/Hook.js:18:14) at Compiler.compile (/home/my_app/public_html/app/laravel/node_modules/webpack/lib/Compiler.js:1092:28)

Specs: Laravel v8 with latest Laravel Mix version Node v16.13.0 NPM v8.1.0

I am using VPS with 8GB of memory.

like image 591
SW Dev Avatar asked Jun 15 '26 18:06

SW Dev


1 Answers

An alternative answer has been posted at here. I used putty as a SSH client from my local machine to access my server and then I ran command (npx mix or npm run dev/prod) and it worked fine. This may not be the best solution but it somehow resolved my issue.

like image 139
SW Dev Avatar answered Jun 17 '26 20:06

SW Dev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!