You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constvalue=/* set from `myEditor.getModel()`: */`function hello() { for (let foo of foo) { foo(); bar; };}`;// Hover on each property to see its docs!constmyEditor=monaco.editor.create(document.getElementById("container"),{
value,language: "javascript",automaticLayout: true,});
Reproduction Steps
Open the playground link and check the developer console.
Uncaught (in promise) RangeError: Maximum call stack size exceeded
at isDeclarationWithExplicitTypeAnnotation (tsWorker.js:73813:55)
at getExplicitTypeOfSymbol (tsWorker.js:73830:17)
at getTypeOfDottedName (tsWorker.js:73862:22)
at getExplicitTypeOfSymbol (tsWorker.js:73835:38)
at getTypeOfDottedName (tsWorker.js:73862:22)
at getExplicitTypeOfSymbol (tsWorker.js:73835:38)
at getTypeOfDottedName (tsWorker.js:73862:22)
at getExplicitTypeOfSymbol (tsWorker.js:73835:38)
at getTypeOfDottedName (tsWorker.js:73862:22)
at getExplicitTypeOfSymbol (tsWorker.js:73835:38)
Actual (Problematic) Behavior
An uncaught error is thrown.
Expected Behavior
No uncaught error.
Additional Context
We use monaco in our game to provide an in-game code editor. A player reported a problem with the in-game editor. In our game, we have a global exception handler. When monaco throws this uncaught error, an error popup is shown.
The MRE uses the player-provided script. I know that for (let foo of foo) { foo(); bar; }; is not valid JS code. Another example:
consta=[()=>{}];constb=0;for(constaofa){a();b}
This is still not valid JS code (ReferenceError: Cannot access 'a' before initialization), but having an uncaught error is unexpected.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAJtAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzdYgm_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKimARHSWlrTPOQHROITHxmAevjJc6KddXWSN1sNwo5JNIgnYWKVmhb0B1SfnroyskXT-0iPN9Jt1ESDDhIFdl9bHkBkOA5r_rmys3ebjP0E59AKwWFt5EBjYnSrRhXL7kWpFwHklYQ1hQUn91POVdA_jOUWtLDn3wCOoajEAmWD58rw5EDD5f2ooMfBxDBAf7mH6cCx3rmhaggrs9a7igEnEmz8gXYmi1SLP36zjlnshLlgjSTmr_6Garow
Monaco Editor Playground Code
Reproduction Steps
Open the playground link and check the developer console.
Actual (Problematic) Behavior
An uncaught error is thrown.
Expected Behavior
No uncaught error.
Additional Context
We use monaco in our game to provide an in-game code editor. A player reported a problem with the in-game editor. In our game, we have a global exception handler. When monaco throws this uncaught error, an error popup is shown.
The MRE uses the player-provided script. I know that
for (let foo of foo) { foo(); bar; };
is not valid JS code. Another example:This is still not valid JS code (
ReferenceError: Cannot access 'a' before initialization
), but having an uncaught error is unexpected.It looks like that monaco is trying to "diagnose" the provided code, and this error is thrown by the TS worker. I'm not sure if this problem should be reported here or at https://github.com/microsoft/TypeScript (the infinite recursion is in https://github.com/microsoft/TypeScript/blob/main/src/compiler/checker.ts).
The text was updated successfully, but these errors were encountered: