When compiling assets using Laravel Mix, I am getting the below error.
Steps I followed:
- Clone Laravel Git
- Install all node_modules using npm install
- 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.