Skip to content

TS 5.1.1-rc: RangeError: Maximum call stack size exceeded #54348

@belgattitude

Description

@belgattitude

Bug Report

Tried an upgrade to 5.1.1-rc from 5.0.4 and got a RangeError: Maximum call stack size exceeded for one of the app of the monorepo (nextjs, mui, i18next,...). Others apps and packages works.

You'll find a reproduction here: belgattitude/nextjs-monorepo-example#3826 with explanation.

git clone https://github.com/belgattitude/nextjs-monorepo-example.git --branch typescript-5.1.1-rc 
yarn install
cd apps/nextjs-app
yarn typecheck

Note that this repo uses yarn 4.0.0-rc.44 with node_modules linker.The cause might be linked to that as well. But in general this example repo used to work across ts updates quite well.

The error is visible on the CI https://github.com/belgattitude/nextjs-monorepo-example/actions/runs/5049578076/jobs/9059197251?pr=3826 and reproduced locally on linux / node 18.16

Just wanted to let you know, didn't had time to investigate.

Huge thx for ts team, I really appreciate what you're doing ❤️

🔎 Search Terms

RangeError: Maximum call stack size exceeded
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63011:28)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)
    at inferFromTypes (/home/sebastien/github/nextjs-monorepo-example/node_modules/typescript/lib/tsc.js:63018:9)

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 5.0.4 and 5.1.1-rc

⏯ Playground Link

belgattitude/nextjs-monorepo-example#3826 with explanation.

git clone https://github.com/belgattitude/nextjs-monorepo-example.git --branch typescript-5.1.1-rc 
yarn install
cd apps/nextjs-app
yarn typecheck

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions