microsoft / microsoft/TypeScript

ERROR: Debug Failure. False expression: Script kind should match provided ScriptKind:8 and sourceFile.scriptKind: 3, !entry:false

Open
#62,293 1 comment 0 reactions 0 assignees View on GitHub
Needs More Info
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

### 🔎 Search Terms

Incremental scenarios
Debug Failure. False expression: Script kind should match provided ScriptKind:8 and sourceFile.scriptKind: 3,!entry:false

### 🕗 Version & Regression Information

- This changed between versions v4.9.5 and v5.2-beta.
- This changed in commit or PR https://github.com/microsoft/TypeScript/pull/54401 or https://github.com/microsoft/TypeScript/pull/54504.
- 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 the problem seems like a occasional problem.

### ⏯ Playground Link

_No response_

### 💻 Code

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

### 🙁 Actual behavior

In incremental scenarios, there are frequent (occasional) errors indicating a mismatch in file types, specifically the error: Debug Failure. False expression: Script kind should match provided ScriptKind:8 and sourceFile.scriptKind: 3,!entry:false. I would like to inquire about the cause of this issue and potential solutions, and also confirm whether the following commits can resolve the aforementioned error:
1. https://github.com/microsoft/TypeScript/pull/54401
2. https://github.com/microsoft/TypeScript/pull/54504
3. https://github.com/microsoft/TypeScript/pull/57641

### 🙂 Expected behavior

We expect the incremental scenario file type to match and throw this error.

### Additional information about the issue

I would like to inquire about the cause of this issue and potential solutions, and also confirm whether the following commits can resolve the aforementioned error:
1. https://github.com/microsoft/TypeScript/pull/54401
2. https://github.com/microsoft/TypeScript/pull/54504
3. https://github.com/microsoft/TypeScript/pull/57641

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the reported incremental-scenario failure and the linked pull requests 54401, 54504, and 57641. Reproduce the intermittent ScriptKind mismatch if possible, then determine whether those changes address it and document the cause or a verified fix.

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.