首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法创建monaco编辑器

无法创建monaco编辑器
EN

Stack Overflow用户
提问于 2019-03-08 05:52:44
回答 1查看 1.1K关注 0票数 0

当我尝试从https://github.com/Microsoft/monaco-editor创建monaco编辑器时,我发现this.model.onDidChangeRawContentFast不是一个函数

代码语言:javascript
运行
复制
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上

代码语言:javascript
运行
复制
import * as monaco from 'monaco-editor';
monaco.editor.create(this.editorContainer.nativeElement);

我通过esm aka npm安装了这个-编辑器,package.json看起来是对的。有没有人遇到过这个错误?

EN

回答 1

Stack Overflow用户

发布于 2019-03-13 02:24:56

我把它修好了,我通过CDN安装了一个旧版本,但那里有一些冲突。删除旧程序包完全删除了错误:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55053391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档