-
Notifications
You must be signed in to change notification settings - Fork 35
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
both ngx-monaco-editor and monaco-editor define MonacoEnvironment #91
Comments
I'm also getting same error |
Also getting the same error |
Same here :D |
Have anyone found workaround for this? |
Hi, it's been a while but I remember coming to the conclusion that this repo is dead and we had to fix our problem. So, I just copied the code of the materia package to my app (as if we wrote it ourselves) and fixed the issue as I explained in my OP. You could also try using only the original one https://microsoft.github.io/monaco-editor/ I don't remember what the difference is or why we ended up using the Materia fork, but I guess we had our reasons. |
thanks @thomasvt |
Hello,
In old major versions, a global variable "MonacoEnvironment" was defined by the monaco-editor package only. But since a few major versions, @materia-ui/ngx-monaco-editor also defines it, causing compile errors when your code imports both:
eg. I need MarkerSeverity and Range from the monaco-editor package because I do things that seem not to be possible through the @materia-ui package. (create squible errors, insert code-snippets)
To get the error, simply create the minimal example like on your github .md and then import something from monaco_editor:
Error TS2451: Cannot redeclare block-scoped variable 'MonacoEnvironment'.
When I manually remove the declaration in node_modules/@materia-ui/... everything works, but of course i cannot do this on our automated build agents.
Is there some way to fix this, please?
The text was updated successfully, but these errors were encountered: