profile
viewpoint

Ask questionsmonaco-editor polute the global variables, making incompatible with other JS libraries, such as CodeMirror, RequireJS, SeaJS, etc.

monaco-editor creates some global variables, such as require, and define, which lead to the following error:

Uncaught Error: Can only have one anonymous define call per script file
    at s.enqueueDefineAnonymousModule (loader.js:1148)
    at o (loader.js:1611)
    at closebrackets.js:8
    at closebrackets.js:11

Can change it to within a namespace, such as monaco.require and monaco.define to make no conflicts?

microsoft/monaco-editor

Answer questions amily666

@alexandrudima i use ngx-monoca-editor in angular7, and have same problem. what should i do?

useful!

Related questions

Monarch: How do you add "@keywords" key to "language object"? (undocumented) hot 3
How to get the line count including line wraps hot 2
Error: Cannot find module 'monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands' hot 2
Removing the tooltip on the read-only editor that says 'cannot edit in read-only editor' hot 1
Monaco paste event hot 1
Registering/Providing custom Commands/CodeActions hot 1
Error: Cannot find module 'monaco-editor/esm/vs/editor/contrib/goToDefinition/goToDefinitionCommands' hot 1
TypeScript declaration preview from extra lib results in error hot 1
Editor props/extends the actual width of the parent that is a flexbox item hot 1
Problem with insane.js while using monaco-editor@0.18.0 hot 1
Change the language of an existing editor hot 1
javascript/typescript typedefs lost when webworker times out hot 1
Can't scroll in firefox hot 1
How to add simple custom language support? hot 1
Highlight merge conflicts in monaco like in VSCode hot 1
Github User Rank List