首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用模块|遇到错误的'Simple upload adapter‘- CKEditorError: ckeditor-duplicated- CKeditor5

无法使用模块|遇到错误的'Simple upload adapter‘- CKEditorError: ckeditor-duplicated- CKeditor5
EN

Stack Overflow用户
提问于 2019-10-23 00:23:06
回答 1查看 3.2K关注 0票数 5

我正在使用reactjs和ckeditor5-react。我正在浏览使用简单上传适配器https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/simple-upload-adapter.html的标准文档

但它失败了,错误如下:

代码语言:javascript
复制
CKEditorError: ckeditor-duplicated-modules: Some CKEditor 5 modules are duplicated. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-ckeditor-duplicated-modules
▶ 2 stack frames were collapsed.
__webpack_require__
D:/Projects/nodejs/node-react-firebase-flashcards/firecards/webpack/bootstrap:785
  782 | };
  783 | 
  784 | // Execute the module function
> 785 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  786 | 
  787 | // Flag the module as loaded
  788 | module.l = true;

package.json相关部分:

代码语言:javascript
复制
  "dependencies": {
    "@ckeditor/ckeditor5-build-classic": "^12.0.0",
    "@ckeditor/ckeditor5-react": "^1.1.3",
    "@ckeditor/ckeditor5-upload": "^12.0.0",

我的导入

代码语言:javascript
复制
import React, { Component } from "react";
import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import SimpleUploadAdapter from "@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter"; ```


Within render:
代码语言:javascript
复制
<CKEditor
            editor={ClassicEditor}
              plugins={SimpleUploadAdapter}
            data="<p>Hello from CKEditor 5!</p>"
            onInit={editor => {
              // You can store the "editor" and use when it is needed.
              console.log("Editor is ready to use!", editor);
            }}
            onChange={(event, editor) => {
              const data = editor.getData();
              this.setState({ cardEditor: data });
              console.log({ event, editor, data });
            }}
            onBlur={(event, editor) => {
              console.log("Blur.", editor);
            }}
            onFocus={(event, editor) => {
              console.log("Focus.", editor);
            }}
          />
代码语言:javascript
复制
I was planning to use this to upload files and images. What could be the reason for this?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-23 00:31:22

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

https://stackoverflow.com/questions/58508534

复制
相关文章

相似问题

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