atularen/ngx-monaco-editor

Uncaught TypeError: Cannot read properties of undefined (reading 'VSCODE_BROWSER_CODE_LOADING'

m-russ opened this issue · 2 comments

Having an issue getting this working in angular 12. I'm running the boilerplate set up in the example. I am receiving this error in the console when I try to load the component Uncaught TypeError: Cannot read properties of undefined (reading 'VSCODE_BROWSER_CODE_LOADING' .

"@angular/cdk": "^12.2.9",
"monaco-editor": "^0.24.0",
"ngx-monaco-editor": "^12.0.0"

app.module.ts

import { MonacoEditorModule } from 'ngx-monaco-editor';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    MonacoEditorModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

editor.component.html

<ngx-monaco-editor [options]="editorOptions" [(ngModel)]="code"></ngx-monaco-editor>

editor.component.ts

...

export class EditorComponent implements OnInit, OnDestroy {
  editorOptions = {theme: 'vs-dark', language: 'javascript'};
  code: string= 'function x() {\nconsole.log("Hello world!");\n}';
  ...
}

could you please elaborate the issue, I didn't get you properly!

I am receiving this error: Uncaught TypeError: Cannot read properties of undefined (reading 'VSCODE_BROWSER_CODE_LOADING' in the web console when I try to load the <ngx-monaco-editor> element after following the sample code in the README.md