microsoft / microsoft/TypeScript

Maximum call stack size exceeded

Open
#62,218 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: API Needs More Info
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

### 🔎 Search Terms

call stack exceeded

### 🕗 Version & Regression Information

- This changed between versions `5.8.3` and `5.9.2`
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______

### ⏯ Playground Link

_No response_

### 💻 Code

```ts
// Your code here
```

### 🙁 Actual behavior

We noticed that there's a potential regression between the versions `5.8.3` and `5.9.2`.

When allowing Dependabot to bump from `5.8.3` to `5.9.2`, we started seeing the `yarn astro check` command failing with the following output:
```
🤟 ~/Sites/[project] (dependabot/npm_and_yarn/dev/typescript-5.9.2): yarn astro check
19:42:18 [content] Syncing content
19:42:18 [content] Synced content
19:42:18 [types] Generated 103ms
19:42:18 [check] Getting diagnostics for Astro files in project...
Maximum call stack size exceeded
Location:
[project]/node_modules/typescript/lib/typescript.js:3371:46
Stack trace:
at String.replace ()
at getCanonicalFileName ([project]/node_modules/typescript/lib/typescript.js:129084:17)
at toPath3 ([project]/node_modules/typescript/lib/typescript.js:127606:12)
at findSourceFile ([project]/node_modules/typescript/lib/typescript.js:128749:20)
at findSourceFile ([project]/node_modules/typescript/lib/typescript.js:128749:20)
```

### 🙂 Expected behavior

I would expect the `yarn astro check` command to succeed with hopefully no type issues since nothing else was changed in the PR other than the version being bumped.

### Additional information about the issue

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with TypeScript 5.8.3 and 5.9.2 using the reported `yarn astro check` command. Inspect the stack trace locations in `node_modules/typescript/lib/typescript.js`, especially `getCanonicalFileName`, `toPath3`, and `findSourceFile`; done means identifying the regression and making the check complete without a maximum call stack error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.