Vue Build fails - UnhandledPromiseRejectionWarning: RangeError: WebAssembly.Instance(): - vue.js

I'm trying to build my vue2 app on my vps, but whenever I run the command
npm run build --- --mode=testing
I get the following error:
Building for testing...(node:82634) UnhandledPromiseRejectionWarning: RangeError: WebAssembly.Instance(): Out of memory: wasm memory
The weird thing is that it works on my local computer.
I tried to change the max_old_space_size up to 20GB but that doesn't do the trick.
I can provide more information but I don't know what's relevant for my question.

Related

I am trying to create vuejs project using cli but foloowing error is showing

failed to load config from /Users/dev.coder/VueQuizApp/vite.config.js
error when starting dev server:
Error: Cannot find module 'node:url'
Require stack:
need a solution for above problem

Vue Project Production build is giving FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

A vue project which was created with node 14. Its running locally fine with
npm run serve
But when I tried to do production build by command
vue-cli service build
it was giving the below error
So I tried building with 4gb and getting same above error and then tried with 6 gb ram with this command
NODE_OPTIONS=--max_old_space_size=6144 vue-cli service build
But there also same result.
I want to deploy it to AWS Amplify, so please give resolution so that I can do production build without allocating extra memory

Why am I getting 'Cannot GET' in localhost for Vue npm run serve

I installed Vite build tool for Vue and when I ran it (npm run serve), I got an error that generated the following message
"Missing script: "serve"".
After a little research, I learned that my package.json was missing the serve key.
After I added it ("serve": "vite preview") and ran it, I received the following error in the browser
"Cannot GET /"
preview is for when your app is already built (with npm run build), it's to check the static result. At the end, serve is the name that was used with Vue2's CLI for preview.
If you want to work locally with it, simply run npm run dev.
More info available on Vite's documentation.

npm run production: Error: Cannot find module './Webpack4Cache'

I keep on getting this error every time I try to run npm run production on the freshly deployed laravel project:
Error: Cannot find module './Webpack4Cache'
I'm deploying to Ubuntu droplet - any idea how to resolve this issue?
CPU usage also goes over 100% when this npm script is running.

yeoman generated app crashes on running grunt command

I am getting the following error when I run the grunt command after generating the app using Yeoman generator:
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
Running "env:dev" (env) task
Running "sass:dist" (sass) task
Running "less:dist" (less) task
Running "jshint:all" (jshint) task
>> 86 files lint free.
Running "csslint:all" (csslint) task
>> 2 files lint free.
Running "mkdir:upload" task
Running "copy:localConfig" (copy) task
Copied 1 file
Running "concurrent:default" (concurrent) task
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
>> Local Npm module "grunt-node-inspector" not found. Is it installed?
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: server.js config/**/*.js
modules/*/server/**/*.js
[nodemon] starting `node --debug server.js`
(node:16253) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
[nodemon] app crashed - waiting for file changes before starting...
I found a similar question(Yeoman grunt could not connect to MongoDB) but I was not able to find the solution to my problem there.
Is that an old version of MEAN.js? I believe grunt was replaced by gulp and also an issue regarding node-inspector was fixed by this pull request.
You should check which version you're using and make the necessary changes.