{"id":551,"hash":"7031385638aa5e65a07d4d5259ce0ef648a1aaa55b8bd2583427fea8d323a5b5","pattern":"Nuxt generate FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory","full_message":"I'm trying to nuxt generate my static (with dynamics url params) html pages.\nHere's my route config in the nuxt.config.js file\n\nroutes: function () {\n      let domain = 'https://example.com'\n      if (process.env.NUXT_ENV === 'dev' || process.env.NUXT_ENV === 'development') {\n        domain = 'https://dev-example.com'\n      }\n      if (process.env.NUXT_ENV === 'local') {\n        domain = 'http://localhost:3002'\n      }\n      let rooms = axios.get(domain + '/nuxt/rooms').then((res) => {\n        if(res && res.data.length){\n          return res.data.map((room) => {\n            return '/manage/pro/room/' + room._id\n          })\n        }else{\n          return []\n        }\n      }).catch(response => {\n        console.log('errore room')\n      });\n      let bookings = axios.get(domain + '/nuxt/users').then((res) => {\n        if(res && res.data.length){\n          return res.data.map((user) => {\n            return '/bookings/' + user.slug\n          })\n        }else {\n          return []\n        }\n      }).catch(response => {\n        console.log('errore rehearsal')\n      });\n      let user = axios.get(domain + '/nuxt/users').then((res) => {\n        if(res && res.data.length){\n          return res.data.map((user) => {\n            return '/user/' + user._id + '/' + user.username\n          })\n        }else {\n          return []\n        }\n      }).catch(response => {\n        console.log('errore user public')\n      });\n      let posts = axios.get(domain + '/nuxt/posts').then((res) => {\n        if(res && res.data.length){\n          return res.data.map((post) => {\n            return '/post/' + post._id\n          })\n        }else {\n          return []\n        }\n      }).catch(response => {\n        console.log('errore posts')\n      });\n      return Promise.all([rooms, posts, user, bookings]).then(values => {\n        return values.join().split(',');\n      })\n    }\n  },\n\nIt' has been always good and the process succeded well till today. Which it seems to require too much RAM memory. Don't know why and don't know how to fix this issue.\nHere's the last console output lines \n\n2018-09-06T13:12:34.423Z nuxt:render Rendering url /manage/pro/room/5b3f26783e62155502337f8f\n\n<--- Last few GCs --->\n\n[14687:0x2c19ac0]   657918 ms: Mark-sweep 1339.9 (1440.7) -> 1328.1 (1440.2) MB, 2760.7 / 0.1 ms  (average mu = 0.224, current mu = 0.161) allocation failure scavenge might not succeed\n[14687:0x2c19ac0]   661179 ms: Mark-sweep 1341.0 (1440.2) -> 1330.6 (1444.2) MB, 2752.4 / 0.1 ms  (average mu = 0.191, current mu = 0.156) allocation failure scavenge might not succeed\n\n<--- JS stacktrace --->\n\n==== JS stack trace =========================================\n\n    0: ExitFrame [pc: 0x5b702a041bd]\n    1: StubFrame [pc: 0x5b702a14fb2]\nSecurity context: 0x3e9218f9e589 <JSObject>\n    2: rules [0x2590b4e7c449] [/node_modules/clean-css/lib/writer/helpers.js:~46] [pc=0x5b704716ec9](this=0x3e348f706519 <JSGlobal Object>,context=0x1a44edae1691 <Object map = 0x169e1dc614d1>,tokens=0x1806c1ded131 <JSArray[2]>)\n    3: all [0x2590b4e7c749] [/node_modules/clean-css/lib...\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n 1: node::Abort() [node]\n 2: 0x89375c [node]\n 3: v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]\n 4: v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]\n 5: 0xe616b2 [node]\n 6: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]\n 7: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n 8: v8::internal::Heap::AllocateRawWithRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]\n 9: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]\n10: v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]\n11: 0x5b702a041bd","ecosystem":"npm","package_name":"vue.js","package_version":null,"solution":"Edit your package.json and modify your start script to use node with --max-old-space-size=4096 flag\nfor example, your package.json may have the following: \n\n\"scripts\": {\n    \"dev\": \"nuxt\",\n    \"build\": \"nuxt build\",\n    \"start\": \"nuxt start\"\n}\n\nUse this instead: \n\n\"scripts\": {\n    \"dev\": \"node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.js nuxt\",\n    \"build\": \"node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.js build\",\n    \"start\": \"node --max-old-space-size=4096 node_modules/nuxt/bin/nuxt.js start\"\n}\n\nSome reference: https://medium.com/@vuongtran/how-to-solve-process-out-of-memory-in-node-js-5f0de8f8464c","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/52205500/nuxt-generate-fatal-error-ineffective-mark-compacts-near-heap-limit-allocation","votes":19,"created_at":"2026-04-19T04:51:19.435308+00:00","updated_at":"2026-04-19T04:51:19.435308+00:00"}