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

[Bug] Editor throws error on dispose after upgrade from 0.51 to 0.52 #4702

Open
2 tasks done
vadimpopa opened this issue Oct 2, 2024 · 1 comment
Open
2 tasks done
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@vadimpopa
Copy link

vadimpopa commented Oct 2, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Reproduction Steps

No response

Actual (Problematic) Behavior

After upgrading from 0.51 to 0.52 we get an error when editor.dispose() is called. I also noticed that when I remove the onDidChangeModelContent listener we don't get the error. It seems that there is some async in here because if I dispose editor in a timeout then I don't get the error as well.
I tried our code in playground, and we couldn't reproduce which is weird too, as we don't have anything uncommon.

We dispose everything as following:

	if (this.modelChangeDisposable) {
            this.modelChangeDisposable.dispose(); // what editorInstance.onDidChangeModelContent returns.
         }
         editor.getModel().dispose();
	editor.dispose();
Screenshot 2024-10-02 at 14 52 05

Expected Behavior

No response

Additional Context

No response

@inad9300
Copy link

inad9300 commented Dec 13, 2024

I started seeing the same problem after upgrading to 0.52.2. Here is my stack trace, in case it helps:

async.js:219 Uncaught (in promise) Canceled: Canceled
    at Delayer.cancel (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:25592:115)
    at Delayer.dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:25602:10)
    at dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34334:13)
    at DisposableStore.clear (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34417:7)
    at DisposableStore.dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34401:10)
    at WordHighlighter.dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:177966:19)
    at WordHighlighterContribution.dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:178017:29)
    at dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34334:13)
    at DisposableMap.clearAndDisposeAll (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34576:7)
    at DisposableMap.dispose (https://localhost:5000/static/js/vendors-node_modules_monaco-editor_esm_vs_editor_editor_main_js.chunk.js:34566:10)

@rzhao271 rzhao271 added the bug Issue identified by VS Code Team member as probable bug label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants