RangeError: Maximum call stack size exceeded

I'm getting this error when I'm deploying my express typescript app that serves and API service using Apollo Graphql + uses bull MQ to connect to a redis instance. Really struggling to debug this because the logs aren't giving me much information: /usr/src/app/node_modules/typescript/lib/typescript.js:65452 function inferFromTypes(source, target) { ^ RangeError: Maximum call stack size exceeded at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65452:30) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) at inferFromTypes (/usr/src/app/node_modules/typescript/lib/typescript.js:65459:11) I'm using a Dockerfile for this
23 Replies
Percy
Percy2y ago
Project ID: N/A
automata
automata2y ago
obscene-current Project Id: e85e85d9-84b4-4d00-bacd-3ea6ff455cc4
Brody
Brody2y ago
what do your memory metrics look like?
Scai
Scai2y ago
I have the same error,
#12 43.20
#12 43.20 > Build error occurred
#12 43.20 RangeError: Maximum call stack size exceeded
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65452:30)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11) {
#12 43.20 type: 'RangeError'
#12 43.20 }

#12 43.27  ELIFECYCLE  Command failed with exit code 1.

#12 ERROR: process "/bin/bash -ol pipefail -c pnpm prisma generate && pnpm build" did not complete successfully: exit code: 1
#12 43.20
#12 43.20 > Build error occurred
#12 43.20 RangeError: Maximum call stack size exceeded
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65452:30)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11)
#12 43.20 at inferFromTypes (/app/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:65459:11) {
#12 43.20 type: 'RangeError'
#12 43.20 }

#12 43.27  ELIFECYCLE  Command failed with exit code 1.

#12 ERROR: process "/bin/bash -ol pipefail -c pnpm prisma generate && pnpm build" did not complete successfully: exit code: 1
Brody
Brody2y ago
?
Scai
Scai2y ago
Brody
Brody2y ago
any reason your app is using ~250mb of ram? or in other words, is that normal for your app?
Scai
Scai2y ago
It's not running at all on development build Only production But there is 231 mb What's weird
Brody
Brody2y ago
sounds like you have a memory leak
Scai
Scai2y ago
It's a simple nextjs application querying some data and showing in the page
Brody
Brody2y ago
yep that will do it
Scai
Scai2y ago
For what I should look first reading the code base and not seeing nothing wrong
Brody
Brody2y ago
im sorry but i have no clue what so ever, do some memory profiling
Scai
Scai2y ago
Found the problem, async components
Brody
Brody2y ago
awsome, that was fast
Scai
Scai2y ago
Apparently is not from async components It's a weird issue regarding typescript itself, updated to typescript nightly release and build fine & deployed on Railway
Brody
Brody2y ago
do you use tsx to run your code? ive heard tsub is much better in terms of memory, though dont know if it would magically fix your leaky problem
Scai
Scai2y ago
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Gonna say it's a default NextJS 13 project
Brody
Brody2y ago
well im out of ideas
Scai
Scai2y ago
For now running typescript on nightly release. Not recommended, but a downgrade would cause compability errors with async components.
Brody
Brody2y ago
eh im sure its fine
automata
automata2y ago
These are what my metrics look like. Running a simple typescript express backend
Scai
Scai2y ago
What is the typescript version @chainlinker ?
Want results from more Discord servers?
Add your server