CKeditor 또 다른 오류, default

열공하는바보·2023년 8월 31일
0

발생 오류
Uncaught SyntaxError: The requested module '/ckeditor5/build/ckeditor.js' does not provide an export named 'default'

출처] https://stackoverflow.com/questions/74559310/uncaught-syntaxerror-the-requested-module-ckeditor5-build-ckeditor-js-does-n

I have the same error but with ReactJS maybe it's work for you also. 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 component. 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}	// ESLint가 에러를 내지만 실제로는 문제 없음!
      data={data}
      onChange={(_, editor) => {
        const data = editor.getData();
        console.log(data);
      }}
    />
  );
};

export default RichText;
profile
안녕하세요

0개의 댓글