When compiling assets using Laravel Mix, I am getting the below error.
Steps I followed:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With