简体   繁体   English

未捕获的语法错误:请求的模块“/ckeditor5/build/ckeditor.js”不提供名为“default”的导出

[英]Uncaught SyntaxError: The requested module '/ckeditor5/build/ckeditor.js' does not provide an export named 'default'

I'm building SPA website with VueJS for frontend and Laravel for backend.我正在构建 SPA 网站,前端使用 VueJS,后端使用 Laravel。 Now I want to add CKEditor custom build to Vue, I have do following steps in CKEditor Documentation, but I received this error:现在我想将 CKEditor 自定义构建添加到 Vue,我在 CKEditor 文档中执行了以下步骤,但我收到此错误:

enter image description here在此处输入图像描述

Here is my code:这是我的代码:

enter image description here在此处输入图像描述

I'm using Vite instead of Webpack, Is it make problem?我用的是 Vite 而不是 Webpack,这有问题吗?

I want to use CKEditor custom build in my vue app我想在我的 vue 应用程序中使用 CKEditor 自定义构建

I have the same error but with ReactJS maybe it's work for you also.我有同样的错误,但 ReactJS 也许它也适合你。 Instead of make a classic import:而不是进行经典导入:

import Editor from '../../path' 

Just import directly like:像这样直接导入即可:

import from '../../path/'

After this, you can use ClassicEditor in your <Ckeditor /> component.在此之后,您可以在<Ckeditor />组件中使用ClassicEditor Here's the full example that works to me:这是对我有用的完整示例:

import { CKEditor } from '@ckeditor/ckeditor5-react';
import 'react-markdown-editor-lite/lib/index.css';
import '../../ckeditor5/build/ckeditor';

const RichText = ({ data }) => {
  return (
    <CKEditor
      editor={ClassicEditor}
      data={data}
      onChange={(_, editor) => {
        const data = editor.getData();
        console.log(data);
      }}
    />
  );
};

export default RichText;

Hope it helps you:)希望对你有帮助:)

暂无
暂无

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

相关问题 未捕获的语法错误:请求的模块“/@modules/vue.js”未提供名为“默认”的导出 - Uncaught SyntaxError: The requested module '/@modules/vue.js' does not provide an export named 'default' 未捕获的语法错误:请求的模块未提供名为的导出 - Uncaught SyntaxError: The requested module does not provide an export named 未捕获的语法错误:请求的模块“/node_modules/.vite/vue.js?v=535663ae”不提供名为“default”的导出 - Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=535663ae' does not provide an export named 'default' 未捕获的语法错误:请求的模块“/node_modules/.vite/vue.js?v=31b05063”不提供名为“默认”的导出 - Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=31b05063' does not provide an export named 'default' 请求的模块“/node_modules/.vite/deps/vue.js”不提供名为“default”的导出 - The requested module '/node_modules/.vite/deps/vue.js' does not provide an export named 'default' Vue JS 错误,请求的模块未提供名为“createApp”的导出 - Vue JS Error , The Requested Module does not provide an export named 'createApp' 请求的模块不提供名为 vuejs 3 的导出 - The requested module does not provide an export named vuejs 3 Vue3 在导入其他组件时,它说请求的模块不提供名为“默认”的导出 - Vue3 when importing other components it says the requested module does not provide an export named 'default' 如何修复“请求的模块不提供名为‘默认’的导出”? - How do I fix "the requested module does not provide an export named 'default'"? VUE中的CKEditor5自定义构建 - CKEditor5 custom build in VUE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM