Monaco-editor: monaco.languages.css === undefined

Created on 26 Sep 2020  路  3Comments  路  Source: microsoft/monaco-editor

We experienced console errors after upgrading monaco-editor from 0.20.0 to 0.21.0 in our application. We access monaco.languages.css.cssDefaults, which was failing because monaco.languages.css is undefined.

Possible cause:
It looks like esm/vs/language/css/monaco.contribution.js contains the line

languages.json = { cssDefaults: cssDefaults, lessDefaults: lessDefaults, scssDefaults: scssDefaults };

(note that it is setting languages.json and not languages.css)

monaco-editor version: 0.21.0+
Browser: Firefox/Electron
OS: macOS
Playground code that reproduces the issue:

console.log({ css: monaco.languages.css, html: monaco.languages.html });

console output:

> Object { css: undefined, html: {鈥 }
bug monaco-css regression

Most helpful comment

published [email protected] with the fix.

All 3 comments

You might want to check with version 0.21.0 since that came out recently.

Sorry that was a typo, it should have said 0.21.0+. I've tried both 0.21.0 and 0.21.1.

This is also reproducible on https://microsoft.github.io/monaco-editor/playground.html.

published [email protected] with the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NikGovorov picture NikGovorov  路  92Comments

akosyakov picture akosyakov  路  16Comments

jayspadie picture jayspadie  路  16Comments

spahnke picture spahnke  路  26Comments

ascoders picture ascoders  路  22Comments