Skip to content

[Bug] Error instantiating monaco in the browser on some users' machines. #5321

@gscshoyru

Description

@gscshoyru

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Reproduction Steps

No response

Actual (Problematic) Behavior

Recently, several users have been having an issue where monaco errors out during instantiation, with a peculiar error message:

Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at nls.ts:106:18
    at copyPasteController.ts:38:94
    at m._invokeFactory (loader.js:1140:41)
    at m.complete (loader.js:1150:36)
    at c._onModuleComplete (loader.js:1765:20)
    at c._onModuleComplete (loader.js:1777:30)
    at c._onModuleComplete (loader.js:1777:30)
    at c._onModuleComplete (loader.js:1777:30)
    at c._onModuleComplete (loader.js:1777:30)
    at c._onModuleComplete (loader.js:1777:30)

This only happens on some user's machines and not others (and not on my own, which makes it difficult to debug). Additionally, the error seems to go away when using incognito or other browsers on the same computer, but clearing the site data on the users computers does not make the error go away. I'm pretty much at a loss as to what could be causing this, and would appreciate any insight if insight is available.
We're creating monaco in the browser in angular using ngx-monaco-editor with the editorOptions of

{
  theme: 'vs-dark',
  language: 'json',
  fontSize: 18,
  minimap: { enabled: true },
  automaticLayout: true,
  readOnly: true,
}

This reproduces on monaco 0.55.1 (I updated to this to see if it would hopefully fix the issue, but no dice).

Let me know if you need any more information from me to try and solve this problem, or if there's anything I could do further to help narrow this down for you (the users are internal, so I can debug just fine on their computers if need be).

Thanks!

Expected Behavior

Loads monaco without error

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions