question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

colorize and colorizeElement methods throw an error with embedded languages

See original GitHub issue

monaco-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:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mofojedcommented, Dec 27, 2019

Looks like 0.19.0 was release which resolves this issue: https://github.com/microsoft/monaco-editor/blob/master/CHANGELOG.md

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found