当我尝试从https://github.com/Microsoft/monaco-editor创建monaco编辑器时,我发现this.model.onDidChangeRawContentFast不是一个函数
ERROR Error: Uncaught (in promise): TypeError:
this.model.onDidChangeRawContentFast is not a function
TypeError: this.model.onDidChangeRawContentFast is not a function
at ViewModel.push../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelImpl.js.ViewModel._registerModelEvents (viewModelImpl.js:141)
at new ViewModel (viewModelImpl.js:68)
at StandaloneEditor.push../node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js.CodeEditorWidget._attachModel (codeEditorWidget.js:939)
at StandaloneEditor.push../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.StandaloneEditor._attachModel (standaloneCodeEditor.js:198)
at new StandaloneEditor (standaloneCodeEditor.js:180)
at standaloneEditor.js:57
at withAllStandaloneServices (standaloneEditor.js:44)
at Object.create (standaloneEditor.js:56)
at MonacoComponent.<anonymous> (monaco.component.ts:167)
at step (tslib.es6.js:97)
at resolvePromise (zone.js:831)
at new ZoneAwarePromise (zone.js:913)
at Module.__awaiter (tslib.es6.js:67)
at MonacoComponent.push../Source/app/shared/components/monaco/monaco.component.ts.MonacoComponent._createEditor (monaco.component.ts:158)
at MonacoComponent.push../Source/app/shared/components/monaco/monaco.component.ts.MonacoComponent.ngAfterViewInit (monaco.component.ts:102)
at callProviderLifecycles (core.js:22406)
at callElementProvidersLifecycles (core.js:22380)
at callLifecycleHooksChildrenFirst (core.js:22370)
at checkAndUpdateView (core.js:23306)
at callViewAction (core.js:23538)这是在angular 7上
import * as monaco from 'monaco-editor';
monaco.editor.create(this.editorContainer.nativeElement);我通过esm aka npm安装了这个-编辑器,package.json看起来是对的。有没有人遇到过这个错误?
发布于 2019-03-13 02:24:56
我把它修好了,我通过CDN安装了一个旧版本,但那里有一些冲突。删除旧程序包完全删除了错误:)
https://stackoverflow.com/questions/55053391
复制相似问题