Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

goncalolopes's avatar

JavaScript heap out of memory

Hi guys, i´m develop an website with laravel and vue.

When i add this {{object.object}}

my npm run watch crash with this error: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

specs:

"header": { "event": "Allocation failed - JavaScript heap out of memory", "trigger": "FatalError", "filename": "report.20200219.105007.8932.0.001.json", "dumpEventTime": "2020-02-19T10:50:07Z", "dumpEventTimeStamp": "1582109407175", "processId": 8932, "cwd": "C:\laragon\www\persona", "commandLine": [ "C:\laragon\bin\nodejs\node-v12\node.exe", "C:\laragon\www\persona\node_modules\webpack\bin\webpack.js", "--progress", "--hide-modules", "--config=node_modules/laravel-mix/setup/webpack.config.js", "--watch" ], "nodejsVersion": "v12.5.0", "wordSize": 64, "arch": "x64", "platform": "win32", "componentVersions": { "node": "12.5.0", "v8": "7.5.288.22-node.14", "uv": "1.29.1", "zlib": "1.2.11", "brotli": "1.0.7", "ares": "1.15.0", "modules": "72", "nghttp2": "1.38.0", "napi": "4", "llhttp": "1.1.4", "http_parser": "2.8.0", "openssl": "1.1.1c", "cldr": "35.1", "icu": "64.2", "tz": "2019a", "unicode": "12.1" },

0 likes
4 replies
goncalolopes's avatar

@fylzero So let me try to explain. Ihave a dashboard, who receive objects through the Laravel Echo. When i receive a post to the dashboard i dispatch the object to the vuex store. When i push one object to the array the dashboard will display it with a v-for and inside the object can be an array that another v-for will display.

data(){ return{ scans: this.$store.getters.bodyScans, } },

Sum Up:

Dashboard can have cards |v-for="scan in scans" ----> List of cards can have a v-for="object in scan.objects" ------>list of Objects

goncalolopes's avatar

The object is like this

{ "timestamp": "2018-05-12T18:39:56.53Z", "id":1, "clear":false, "objects": [ { "object": "OBJ1", "location": "B1" }, { "object": "OBJ2", "location": "B2" } ]

}

the first v-for loop through the objects and the nested for iterate the "object.objects"

fylzero's avatar

@goncalolopes I'm going to suggest something that could be extremely wrong / offbase. I would avoid using the word "object" as that is sort of a known magic word in programming. What are the objects actually? Can you put a name to that and change the name to like objName?

This might not be the root of your problem but it is the only glaring issue I see.

24 likes

Please or to participate in this conversation.