简体   繁体   English

语法错误:错误:无法加载要扩展的配置“ckeditor5”。 将 CKEditor 导入 Vuejs 时

[英]Syntax Error: Error: Failed to load config “ckeditor5” to extend from. While importing CKEditor to Vuejs

Hi guys so currently im encountering a problem.大家好,所以目前我遇到了一个问题。 Im trying customize a build, so everything works fine in the ckeditor ( which i cloned ) the sample.html works fine too.我正在尝试自定义构建,因此在 ckeditor (我克隆的)样本中一切正常。html 也可以正常工作。 But when im trying to implement the customize build in Vue 2 i got the error like the title ( the original works okay btw, like the classic build ).但是当我尝试在 Vue 2 中实现自定义构建时,我得到了类似标题的错误(顺便说一句,原始作品还可以,就像经典构建一样)。

Syntax Error: Error: Failed to load config "ckeditor5" to extend from.
Referenced from: C:\Users\nam\Desktop\CKEditorLib\ckeditor5\.eslintrc.js
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at _normalizeObjectConfigData.next (<anonymous>)

I dont know why the referenced error is from the library, not the package that i have installed.我不知道为什么引用的错误来自库,而不是我安装的 package。 Here is my package.json这是我的 package.json

"@ckeditor/ckeditor5-adapter-ckfinder": "^24.0.0",
    "@ckeditor/ckeditor5-alignment": "^24.0.0",
    "@ckeditor/ckeditor5-autoformat": "^24.0.0",
    "@ckeditor/ckeditor5-basic-styles": "^24.0.0",
    "@ckeditor/ckeditor5-block-quote": "^24.0.0",
    "@ckeditor/ckeditor5-build-custom": "file:../../CKEditorLib/ckeditor5/packages/ckeditor5-build-custom",
    "@ckeditor/ckeditor5-ckfinder": "^24.0.0",
    "@ckeditor/ckeditor5-core": "^24.0.0",
    "@ckeditor/ckeditor5-dev-utils": "^20.0.0",
    "@ckeditor/ckeditor5-dev-webpack-plugin": "^23.6.1",
    "@ckeditor/ckeditor5-easy-image": "^24.0.0",
    "@ckeditor/ckeditor5-editor-classic": "^24.0.0",
    "@ckeditor/ckeditor5-essentials": "^24.0.0",
    "@ckeditor/ckeditor5-heading": "^24.0.0",
    "@ckeditor/ckeditor5-image": "^24.0.0",
    "@ckeditor/ckeditor5-indent": "^24.0.0",
    "@ckeditor/ckeditor5-link": "^24.0.0",
    "@ckeditor/ckeditor5-list": "^24.0.0",
    "@ckeditor/ckeditor5-media-embed": "^24.0.0",
    "@ckeditor/ckeditor5-paragraph": "^24.0.0",
    "@ckeditor/ckeditor5-paste-from-office": "^24.0.0",
    "@ckeditor/ckeditor5-table": "^24.0.0",
    "@ckeditor/ckeditor5-theme-lark": "^24.0.0",
    "@ckeditor/ckeditor5-typing": "^24.0.0",
    "@ckeditor/ckeditor5-vue2": "^1.0.5",
    "core-js": "^3.6.5",
    "postcss-loader": "^3.0.0",
    "raw-loader": "^0.5.1",
    "style-loader": "^1.2.1",
    "terser-webpack-plugin": "^3.0.2",
    "vue": "^2.6.11",
    "webpack": "^4.43.0",
    "webpack-cli": "^3.3.12"

And here is the code in.vue file, one thing这是.vue文件中的代码,一件事

<template>
  <div class="hello">
    <ckeditor 
      :editor="editor" 
      v-model="editorData" 
      :config="editorConfig">
    </ckeditor>
  </div>
</template>

<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-custom/src/ckeditor'
//Same error happened if i try to import ClassicEditor from /buid/ckeditor

export default {
  name: 'HelloWorld',
  data() {
    return {
        editor: ClassicEditor,
        editorData: '<p>Content of the editor.</p>',
        editorConfig: {
            // The configuration of the editor.
        }
    };
  }
}
</script>

Thank you for reading, will be appreciated for any help感谢您阅读,将不胜感激任何帮助

So this popup becauseof the conflict version of ESLint in my package.json and in ckeditor5 ( which i forked ) is different.因此,由于我的 package.json 和 ckeditor5(我分叉)中 ESLint 的冲突版本,此弹出窗口是不同的。

Anyway, if you want to build a custom like me无论如何,如果你想建立一个像我一样的定制

  1. Fork all the repo.分叉所有回购。
  2. Create your custom build but dont push it into the repo which you forked.创建您的自定义构建,但不要将其推送到您分叉的存储库中。
  3. Instead create a new reposity, push your custom build into there.相反,创建一个新的存储库,将您的自定义构建推送到那里。
  4. Install it via通过安装它
npm i <your-github-name>/<your-repo-name>#<your-branch>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM