onMouseLeave throws uncaught canceled
See original GitHub issueI’m seeing uncaught errors when moving the cursor between the two halves of createDiffEditor
.
Steps to Reproduce:
- Open up this HTML snippet, with dev tools running.
<!DOCTYPE html>
<html>
<body>
<div style="height: 50vh"></div>
<script>
window.require = {
paths: {
vs:
"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.23.0/min/vs/",
},
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.23.0/min/vs/loader.min.js"></script>
<script>
require(["vs/editor/editor.main"], () => {
const elem = document.querySelector("div");
const editor = monaco.editor.createDiffEditor(elem);
const original = monaco.editor.createModel("foo");
const modified = monaco.editor.createModel("bar");
editor.setModel({ original, modified });
});
</script>
</body>
</html>
- Click anywhere on Monaco editor.
- Move the mouse between the two editor halves.
- You should see uncaught errors in the console log.
Error Output:
Uncaught (in promise) Canceled: Canceled
at Object.d [as canceled] (/monaco/min/vs/editor/editor.main.js:8:711)
at g.cancel (/monaco/min/vs/editor/editor.main.js:51:15831)
at Function.onMouseLeave (/monaco/min/vs/editor/editor.main.js:103:10222)
at /monaco/min/vs/editor/editor.main.js:103:5373
at p.fire (/monaco/min/vs/editor/editor.main.js:51:1836)
at HTMLDivElement.g (/monaco/min/vs/editor/editor.main.js:51:6378)
Notes
- Reproduced in
0.22.x
and0.23.0
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:13 (5 by maintainers)
Top Results From Across the Web
JavaScript cancel "mouseleave" event on "click" - Stack Overflow
I'm not able to cancel the "mouseleave" event. That element should only disappear when I click on "X" - but thats no problem....
Read more >Uncaught Action failed: [Cannot read properties of undefined ...
Hi All, When i enter any word in the lookup in the component i ma getting this error: Uncaught Action failed: ...
Read more >HTMLUncaughtScriptExceptionEvent - ActionScript 3.0 Language ...
An HTMLLoader object dispatches an HTMLUncaughtScriptExceptionEvent object whenever a JavaScript exception is thrown and not handled with a catch statement.
Read more >Safari Technology Preview Release Notes - Apple Developer
toMatrix() to throw an exception if its length is not compatible with a px unit ... Updated Web Inspector to show the uncaught...
Read more >Event loops - HTML Spec
JSON module scripts represent a parsed JSON document. As CSS stylesheets and JSON documents do not import dependent modules, and do not throw...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🤷♂️ . This was fixed in https://github.com/microsoft/vscode/commit/49cad9a1c0d9ef01d66eef60b261c7ebcffcef23 , so it was addressed. I then went beyond fixing and offered you a temporary workaround you can use until we ship a new editor version.
Found it. You could do the following in your app: