colorize and colorizeElement methods throw an error with embedded languages
See original GitHub issuemonaco-editor version: 0.18.1 Browser: Chrome 78.0.3904.70 OS: macOS Catalina
Steps or JS usage snippet reproducing the issue: Mentioned in this stackoverflow: https://stackoverflow.com/questions/58246978/monaco-editor-colorize-throw-an-exception-when-html-includes-script-tag Demonstrated in this Fiddle: https://jsfiddle.net/tndefzsu/
It would appear the colorize/colorizeElement methods no longer work, returning an error such as:
TypeError: this._embeddedModes.hasOwnProperty is not a function
at MonarchTokenizer.getLoadStatus (monarchLexer.js:426)
at execute (colorizer.js:149)
at colorizer.js:160
at new Promise (<anonymous>)
at _colorize (colorizer.js:144)
at Function.Colorizer.colorize (colorizer.js:64)
at Function.Colorizer.colorizeElement (colorizer.js:36)
This used to be working fine in 0.17, and appears to be a new issue with 0.18.1
This seems to be an issue with languages that contain embedded languages (like html).
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
View Raw - UNPKG
export function colorizeElement(domNode: HTMLElement, ... such that their combination goes beyond the beginning or * end of the model, throws an exception.
Read more >Embedded Programming Languages - Visual Studio Code
This guide includes two samples that illustrate two approaches to build such a language server: Language Services and Request Forwarding. We'll review both ......
Read more >Prism
Extensible Define new languages or extend existing ones. Add new features thanks to Prism's plugin architecture. Easy styling All styling is done through...
Read more >https://code.gitlink.org.cn/baladiwei/build/commit...
addEventListener("fetch",function(a){if("GET"===a.request.method){var c ... c;throw Error("The cached response that was expected is missing.
Read more >A Poor Man's Domain Specific Language Implementation
Firstly, a pure embedding in a powerful, statically typed host language Scala. ... _) => throw new RuntimeException("Parsing failure: " + m) case...
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
Looks like 0.19.0 was release which resolves this issue: https://github.com/microsoft/monaco-editor/blob/master/CHANGELOG.md
Issue already described here: https://github.com/microsoft/vscode/issues/84394 Fixed with https://github.com/microsoft/vscode/commit/38ac339e7aa481b0f618eb8edb7948954ddf6277