Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

sapper run dev: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #1779

Open
btakita opened this issue Jun 10, 2021 · 3 comments

Comments

@btakita
Copy link
Contributor

btakita commented Jun 10, 2021

On a large project which uses pnpm with many packages & sapper run dev, when a file changes, sapper reloads then panics with a FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory error. This issue did not occur over the last few months but has begun occurring.

I'm attempting to run the process using node --max-old-space-size=8192, but ran into issues passing cli arguments directly to nodejs. To fix, I have the script:

#!/bin/sh
cat ./node_modules/.bin/sapper | sed -E 's/(node\"?)(\s+\")/\1 --max-old-space-size=8192 \2/' > ./node_modules/.bin/sapper-himem
chmod a+x ./node_modules/.bin/sapper-himem
./node_modules/.bin/sapper-himem dev

I tried several other solutions but had to use sed to inject cli args to the node process. A proper solution would be to have a way to pass cli args from the sapper script into the node process.

@Maggi64
Copy link

Maggi64 commented Jun 21, 2021

Fixed with the latest rollup update 👍

@rohanrichards
Copy link

rohanrichards commented Nov 1, 2021

I just updated to rollup 2.58.1 and I'm still getting this. I'm also deploying via heroku, and increasing the --max-old-space-size variable has caused it to just hang (it's been stuck on the build phase for 30 minutes now).

Edit; This only happens to me during a build

@perqa
Copy link

perqa commented Jan 2, 2022

Same issue with sveltekit and this package.json

      "devDependencies": {
   	"@sveltejs/adapter-netlify": "^1.0.0-next.35",
   	"@sveltejs/adapter-node": "^1.0.0-next.55",
   	"@sveltejs/adapter-static": "^1.0.0-next.21",
   	"@sveltejs/kit": "^1.0.0-next.201",
   	"@typescript-eslint/eslint-plugin": "^5.5.0",
   	"@typescript-eslint/parser": "^5.5.0",
   	"autoprefixer": "^10.4.0",
   	"cssnano": "^5.0.12",
   	"eslint": "^8.4.0",
   	"eslint-config-prettier": "^8.3.0",
   	"eslint-plugin-svelte3": "^3.2.1",
   	"node-fetch": "^3.1.0",
   	"postcss": "^8.4.4",
   	"postcss-load-config": "^3.1.0",
   	"prettier": "~2.5.1",
   	"prettier-plugin-svelte": "^2.5.0",
   	"stream": "^0.0.2",
   	"svelte": "^3.44.2",
   	"svelte-preprocess": "^4.9.8",
   	"tailwindcss": "^2.2.19",
   	"tslib": "^2.3.1",
   	"typescript": "^4.5.2",
   	"vite": "^2.6.14"
   },
   "type": "module",
   "engines": {
   	"node": ">= 12.17.0"
   },
   "dependencies": {
   	"@tailwindcss/line-clamp": "^0.2.2",
   	"lrud": "file:../lrud",
   	"sapper-environment": "^1.0.1"
   }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants