mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Handle known bug (monaco-editor issue No 2382)
- handles "Uncaught (in promise) Canceled: Canceled"
This commit is contained in:
		| @@ -148,6 +148,20 @@ RED.editor.codeEditor.monaco = (function() { | ||||
|  | ||||
|  | ||||
|     function init(options) { | ||||
|  | ||||
|         //Handles "Uncaught (in promise) Canceled: Canceled" | ||||
|         //@see https://github.com/microsoft/monaco-editor/issues/2382 | ||||
|         //This is fixed in commit microsoft/vscode@49cad9a however it is not yet present monaco-editor | ||||
|         //Remove the below addEventListener once monaco-editor V0.23.1 or greater is published | ||||
|         window.addEventListener('unhandledrejection', (evt) => { | ||||
|             if(evt && evt.reason && evt.reason.stack) { | ||||
|                 if (evt.reason.name === 'Canceled' && evt.reason.stack.indexOf('vendor/monaco/dist') >= 0) { | ||||
| 		            evt.preventDefault(); | ||||
| 		            evt.stopImmediatePropagation(); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|  | ||||
|         options = options || {}; | ||||
|         window.MonacoEnvironment = window.MonacoEnvironment || {}; | ||||
|         window.MonacoEnvironment.getWorkerUrl = function (moduleId, label) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user