I am facing an issue with monaco-editor, specifically since version 16 of ngx-monaco-editor-v2, monaco-editor v0.41, and angular v16.
The error in console is Cannot read properties of undefined (reading 'replace')
, here’s a screenshot of the error
error monaco editor
I tried bumping all to version 17 with angular 17, and still facing the same issue.
I also tried to just declare a basic in html, just basic config, but same result with error in console, and broken editor.
Here’s my package.json:
"dependencies": {
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.12",
"@angular/common": "^16.2.12",
"@angular/compiler": "^16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/localize": "^16.2.12",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",
"@fortawesome/fontawesome-free": "^6.1.1",
"@nebular/eva-icons": "12.0.0",
"@nebular/theme": "12.0.0",
"@ng-bootstrap/ng-bootstrap": "~15.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@popperjs/core": "^2.11.8",
"bootstrap": "5.2.0",
"chart.js": "^3.9.1",
"chartjs-adapter-moment": "^1.0.1",
"d3": "^7.8.0",
"eva-icons": "^1.1.3",
"file-saver-es": "^2.0.5",
"font-awesome-animation": "0.2.1",
"js-yaml": "^4.1.0",
"moment": "^2.29.4",
"monaco-editor": "^0.41.0",
"ngx-monaco-editor-v2": "^16.0.1",
"normalize.css": "6.0.0",
"pace-js": "1.0.2",
"pako": "^2.1.0",
"popper.js": "^1.16.1",
"rxjs": "6.6.7",
"socket.io-client": "^2.4.0",
"tslib": "^2.4.0",
"zone.js": "~0.13.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.14",
"@angular-eslint/builder": "16.3.1",
"@angular-eslint/eslint-plugin": "16.3.1",
"@angular-eslint/eslint-plugin-template": "16.3.1",
"@angular-eslint/schematics": "16.3.1",
"@angular-eslint/template-parser": "16.3.1",
},
I found 2 issues about the error, but they seem not to be related
https://github.com/microsoft/monaco-editor/issues/1192
https://github.com/Microsoft/monaco-editor/issues/1321
Thanks in advance for any help