The Wayback Machine - https://web.archive.org/web/20220323002122/https://github.com/unifiedjs/unified/discussions/175
Skip to content

typescript hangs when compiling plugin with tsc 4.5 #175

typescript hangs when compiling plugin with tsc 4.5 #175
Nov 22, 2021 · 2 answers · 6 replies

i'm not sure if this s a typescript or a unified issue, but i'm having trouble compiling a simple plugin with ts 4.5 (tsc just hangs):

could somebody try building this example: https://github.com/stefanprobst/issue-tsc

notes:

  • when removing the third arg (parent) to the visitor function, this compile sfine
  • ts 4.4.4 also seems to work

Given that it works in 4.4 and breaks in 4.5 I tend do think this is a TS bug. 🤔
Maybe an edge case with https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#tailrec-conditional ?

But we may end up having to update unified if the answer is similar to microsoft/TypeScript#26314 or microsoft/TypeScript#25942 (comment)

Replies

2 suggested answers
·
6 replies

Given that it works in 4.4 and breaks in 4.5 I tend do think this is a TS bug. 🤔
Maybe an edge case with https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#tailrec-conditional ?

But we may end up having to update unified if the answer is similar to microsoft/TypeScript#26314 or microsoft/TypeScript#25942 (comment)

6 replies
@stefanprobst

yes, filed a bug report, and it looks like it is a ts issue.

@ChristianMurphy

Thanks, linking for reference microsoft/TypeScript#46900

@styxlab

Just experiencing the same issue. I changed typescript to 4.4.4 in package.json but that did not help. tsc -v shows 4.5.2 do I need to downgrade that too?

Answer selected by stefanprobst

This has been resolved in TypeScript 4.6 https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/#improved-recursion-depth-checks
The fix has also been backported to 4.5

You may already have this change because it was cherry-picked into TypeScript 4.5.3

0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants