Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Failure #43011

Closed
nuanyang233 opened this issue Mar 1, 2021 · 6 comments · Fixed by #43024
Closed

Debug Failure #43011

nuanyang233 opened this issue Mar 1, 2021 · 6 comments · Fixed by #43024
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fix Available A PR has been opened for this issue

Comments

@nuanyang233
Copy link

Bug Report

Upgrade in v4.2.2 (also an issue in v4.2.1-rc, tsc fail to compile with an error Debug Failure.

🔎 Search Terms

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions v4.2.1-beta and v4.2.2-rc
  • This is the behaviour in every version I tried, and I reviewed the FAQ for entries about "Debug Failure."

⏯ Playground Link

💻 Code

Maskbook

🙁 Actual behavior

Error: Debug Failure.
    at Object.getModuleSpecifiers (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:91587:30)
    at getSpecifierForModuleSymbol (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:39998:62)
    at createExpressionFromSymbolChain (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:40172:63)
    at symbolToExpression (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:40159:24)
    at /Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:38966:106
    at withContext (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:39005:37)
    at symbolToExpression (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:38966:28)
    at symbolToStringWorker (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:38886:30)
    at Object.usingSingleLineStringWriter (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:10151:13)
    at symbolToString (/Maskbook/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/tsc.js:38884:73)


🙂 Expected behavior

It should compile.

@Jack-Works
Copy link
Contributor

Jack-Works commented Mar 1, 2021

I have done a simple debug. Here is some useful information:

  1. The crash happens at the type checking stage. For file (packages\theme\src\Components\ErrorBoundary\CrashUI.tsx)
  2. Current type checking node is at line 68, <code>{error.stack}</code>
  3. Here is the longer version of the call stack

image
image

@Jack-Works
Copy link
Contributor

Seems like it failed to createSignatureForJSXIntrinsic (<code>) in our codebase

@divdavem
Copy link

divdavem commented Mar 1, 2021

I have a similar Debug Failure error when upgrading typescript from version 4.1.5 to 4.2.2 in assistive-webdriver.

I have reproduced the error in this simple repository.
The only typescript code is:

import { format } from "winston";

export const messageId = format((info) => info);

Note that the error seems to only happen when dependencies are installed with pnpm, but not when they are installed with npm.

To reproduce the issue:

git clone https://github.com/divdavem/typescriptUpgradeIssue.git
cd typescriptUpgradeIssue
pnpm install

Here is the error I am getting:

Error: Debug Failure.
    at Object.getModuleSpecifiers (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:111579:30)
    at getSpecifierForModuleSymbol (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48852:62)
    at /tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48710:39
    at Array.map (<anonymous>)
    at getSymbolChain (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48708:58)
    at lookupSymbolChainWorker (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48692:51)
    at lookupSymbolChain (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48685:24)
    at symbolToTypeNode (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:48859:29)
    at typeToTypeNodeHelper (/tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:47937:28)
    at /tmp/typescriptUpgradeIssue/node_modules/.pnpm/typescript@4.2.2/node_modules/typescript/lib/typescript.js:47740:106

@Jack-Works
Copy link
Contributor

Interesting point. IIRC typescript has fixed a bug for pnpm auto import caching recently

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels Mar 1, 2021
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Mar 1, 2021
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.2.3 milestone Mar 1, 2021
@divdavem
Copy link

divdavem commented Mar 5, 2021

With Typescript 4.2.3, it works fine for me now!
@andrewbranch Thank you for fixing this bug. 👍

@rhyek
Copy link

rhyek commented Mar 5, 2021

So glad this was fixed. You guys are great. I'd been following the updates for pnpm on 4.2 before its release and recently hit this issue on a private repo and couldn't reproduce it on a separate public one so wasn't sure how to report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fix Available A PR has been opened for this issue
Projects
None yet
6 participants