Node Heap Allocation Issue

I don't know why this keeps happening but sometimes when I try to build I get an out of memory issue. I tried giving node 16gb but it just took all of it and threw out of memory again. So I assume this is a memory leak when I run tsc. I dont know why somtimes it worked and other times not but now its not working anymore and I have no clue why or how to fix it. ChatGPT just says well give it more memory. Has anybody an idea? Here is my package.json and tsconfig: (I never had this before and my tsc works fine with other projects)
Solution:
cant really follow on the discussion there but fixed it for now using pnpm update. I guess some lib was outdated with that bug
Jump to solution
8 Replies
Goosy
GoosyOP2y ago
{
"type": "commonjs",
"main": "dist/index.js",
"engines": {
"node": ">=16.6.0"
},
"dependencies": {
"@sapphire/decorators": "^6.0.1",
"@sapphire/discord-utilities": "^3.0.3",
"@sapphire/discord.js-utilities": "6.0.7",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "^4.4.3",
"@sapphire/pieces": "^3.6.3",
"@sapphire/plugin-api": "^5.0.3",
"@sapphire/plugin-editable-commands": "^3.0.2",
"@sapphire/plugin-logger": "^3.0.3",
"@sapphire/plugin-subcommands": "^4.0.1",
"@sapphire/time-utilities": "^1.7.9",
"@sapphire/type": "^2.4.0",
"@sapphire/utilities": "^3.11.1",
"@skyra/env-utilities": "^1.2.0",
"colorette": "^2.0.20",
"discord.js": "^14.10.2",
"dotenv": "^16.0.3",
"firebase-admin": "^11.9.0",
"tslib": "^2.5.3",
"typescript": "^5.1.3"
},
"devDependencies": {
"@sapphire/cli": "^1.6.1",
"@sapphire/prettier-config": "^1.4.5",
"@sapphire/ts-config": "^4.0.0",
"@types/node": "^18.16.3",
"@types/ws": "^8.5.4",
"cross-env": "^7.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"ts-node-dev": "^2.0.0"
},
"scripts": {
"sapphire": "sapphire",
"generate": "sapphire generate",
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/index.js",
"dev": "run-s build start",
"watch:start": "ts-node-dev --respawn --transpile-only dist/index.js",
"format": "prettier --write \"src/**/*.ts\""
}
}
{
"type": "commonjs",
"main": "dist/index.js",
"engines": {
"node": ">=16.6.0"
},
"dependencies": {
"@sapphire/decorators": "^6.0.1",
"@sapphire/discord-utilities": "^3.0.3",
"@sapphire/discord.js-utilities": "6.0.7",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "^4.4.3",
"@sapphire/pieces": "^3.6.3",
"@sapphire/plugin-api": "^5.0.3",
"@sapphire/plugin-editable-commands": "^3.0.2",
"@sapphire/plugin-logger": "^3.0.3",
"@sapphire/plugin-subcommands": "^4.0.1",
"@sapphire/time-utilities": "^1.7.9",
"@sapphire/type": "^2.4.0",
"@sapphire/utilities": "^3.11.1",
"@skyra/env-utilities": "^1.2.0",
"colorette": "^2.0.20",
"discord.js": "^14.10.2",
"dotenv": "^16.0.3",
"firebase-admin": "^11.9.0",
"tslib": "^2.5.3",
"typescript": "^5.1.3"
},
"devDependencies": {
"@sapphire/cli": "^1.6.1",
"@sapphire/prettier-config": "^1.4.5",
"@sapphire/ts-config": "^4.0.0",
"@types/node": "^18.16.3",
"@types/ws": "^8.5.4",
"cross-env": "^7.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"ts-node-dev": "^2.0.0"
},
"scripts": {
"sapphire": "sapphire",
"generate": "sapphire generate",
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/index.js",
"dev": "run-s build start",
"watch:start": "ts-node-dev --respawn --transpile-only dist/index.js",
"format": "prettier --write \"src/**/*.ts\""
}
}
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo",
"noUnusedLocals": false,
"noUnusedParameters": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"importHelpers": true,
"paths": {
"tslib" : ["./node_modules/tslib/tslib.d.ts"]
},
},
"include": ["src"]
}
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo",
"noUnusedLocals": false,
"noUnusedParameters": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"importHelpers": true,
"paths": {
"tslib" : ["./node_modules/tslib/tslib.d.ts"]
},
},
"include": ["src"]
}
Goosy
GoosyOP2y ago
Goosy
GoosyOP2y ago
Solution
Goosy
Goosy2y ago
cant really follow on the discussion there but fixed it for now using pnpm update. I guess some lib was outdated with that bug
Swiizyy
Swiizyy2y ago
yes it is 👍
Goosy
GoosyOP2y ago
thx though
Favna
Favna2y ago
@sapphire/shapeshift -> @discordjs/builders -> discord.js it's a transitive dependency
Want results from more Discord servers?
Add your server