Open bsivanov opened 3 years ago
I am in the same situation and have found the most horrible workaround I can think of. If you import Monaco directly in your component (import * as Monaco from "monaco-editor";
) you can use something like Monaco.Uri.parse(`/${this.modelUrlType}/${this.modelUrlId}`);
to generate an instance that is compatible with the lazily loaded Monaco. It just adds something like ~ 7 Mb to your bundle size ...
Indeed, this is a strong regression we are also experiencing.
I was using the editor for editing JSON with predefined schema with the older versions, but it seems this is not possible now with v12.0.0.
I have the following code (same as in the samples):
but if I try to create the model like in the samples:
this wouldn't be working as the
monaco.Uri.parse
is still not loaded. In the samples this is working purely by chance, as the model is created in theonInit
handler of a previous editor.I though that I would be able to update the model in the
onInit
of the same editor, where themonaco.Uri.parse
will be available:but in this case the binding is not working and the model stays the old one (I tried adding
'something'
at the end of the code, and it didn't appear in the editor).I also tried setting the model directly in
onInit
:but this is again not working (the code is not even validated as JSON), now the following error appears in the Debug Console: