Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was 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

@btakita

Description

@btakita

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions