Closed SamVerschueren closed 1 month ago
monaco is including /workspaces/monaco-editor/src/language/typescript/lib/typescriptServices.js
in the compilation, I think intentionally. I think this only repros during emit, and I believe it's from processing that file. I don't know why we need to do all this work for JS emit.
Also, this goes away if you drop the config for checkJs: false
.
Huh, funny. Two things I wanna do then:
forEachChildRecursively
in all of the AST walks, so it shouldn't be raw AST depth that's an issue - more likely there's accidental reentrancy I need to fix.So, weirdly enough, this is fixed in main
, and by my measurements, because of #59183. That PR was not, explicitly, a crash bugfix, so that's a little odd, but reverting it does reintroduce the crash, so it is definitely the fix. This is a guess, but I assuming removing checkMode
from getTypeOfVariableOrParameterOrProperty
(thus ensuring it always caches) is what fixed the crash (since it does appear in the stack trace above).
In any case, that makes this "fixed", but to my second point above, I've opened #59398 with the fast bail-outs to avoid the reference walking pass in some common cases that don't need it.
@DanielRosenwasser this is scheduled for a patch release, but #59183 seems like an odd change to port, being a behavioral change - how do you feel about this?
🔎 Search Terms
"maximum call stack size"
🕗 Version & Regression Information
⏯ Playground Link
No response
💻 Code
Not sure which code causes the crash.
🙁 Actual behavior
When compiling monaco-editor with TypeScript@5.5.2 or higher, it will result in a
Maximum call stack size exceeded
.npm run build-monaco-editor
(this will work as it uses TypeScript@5.4.5)npm install typescript@5.5.2
npm run build-monaco-editor
again (this will fail)🙂 Expected behavior
When compiling
monaco-editor
with the latest TypeScript, I shouldn't be seeing aMaximum call stack size exceeded
.Additional information about the issue
No response