ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Editor initialization failed. Cannot read properties of null (reading 'getAttribute')

Open yukai3804 opened this issue 2 years ago • 2 comments

📝 Ask a question

image

` /**

  • @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  • For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */

// The editor creator to use. import { ClassicEditor as ClassicEditorBase } from "@ckeditor/ckeditor5-editor-classic";

import Essentials from "@ckeditor/ckeditor5-essentials/src/essentials"; import UploadAdapter from "@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter"; import Autoformat from "@ckeditor/ckeditor5-autoformat/src/autoformat"; import Bold from "@ckeditor/ckeditor5-basic-styles/src/bold"; import Italic from "@ckeditor/ckeditor5-basic-styles/src/italic"; import BlockQuote from "@ckeditor/ckeditor5-block-quote/src/blockquote"; import CKFinder from "@ckeditor/ckeditor5-ckfinder/src/ckfinder"; import EasyImage from "@ckeditor/ckeditor5-easy-image/src/easyimage"; import Heading from "@ckeditor/ckeditor5-heading/src/heading"; import Image from "@ckeditor/ckeditor5-image/src/image"; import ImageCaption from "@ckeditor/ckeditor5-image/src/imagecaption"; import ImageStyle from "@ckeditor/ckeditor5-image/src/imagestyle"; import ImageToolbar from "@ckeditor/ckeditor5-image/src/imagetoolbar"; import ImageUpload from "@ckeditor/ckeditor5-image/src/imageupload"; import Indent from "@ckeditor/ckeditor5-indent/src/indent"; import Link from "@ckeditor/ckeditor5-link/src/link"; import List from "@ckeditor/ckeditor5-list/src/list"; import MediaEmbed from "@ckeditor/ckeditor5-media-embed/src/mediaembed"; import Paragraph from "@ckeditor/ckeditor5-paragraph/src/paragraph"; import PasteFromOffice from "@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice"; import Table from "@ckeditor/ckeditor5-table/src/table"; import TableToolbar from "@ckeditor/ckeditor5-table/src/tabletoolbar"; import TextTransformation from "@ckeditor/ckeditor5-typing/src/texttransformation";

import { CloudServices } from "@ckeditor/ckeditor5-cloud-services"; import { ImportWord } from "@ckeditor/ckeditor5-import-word"; import "@ckeditor/ckeditor5-build-classic/build/translations/zh-cn";

class ClassicEditor extends ClassicEditorBase {}

ClassicEditor.builtinPlugins = [ Essentials, UploadAdapter, Autoformat, Bold, Italic, BlockQuote, CKFinder, EasyImage, Heading, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, Indent, Link, List, MediaEmbed, Paragraph, PasteFromOffice, Table, TableToolbar, TextTransformation, CloudServices, ImportWord, ];

// Editor configuration. ClassicEditor.defaultConfig = { toolbar: { items: [ "heading", "importWord", "|", "bold", "italic", "link", "bulletedList", "numberedList", "|", "indent", "outdent", "|", "imageUpload", "blockQuote", "insertTable", "mediaEmbed", "undo", "redo", ], }, image: { toolbar: [ "imageStyle:full", "imageStyle:side", "|", "imageTextAlternative", ], }, table: { contentToolbar: ["tableColumn", "tableRow", "mergeTableCells"], }, cloudServices: { tokenUrl: "https://107002.cke-cs.com/token/dev/?limit=10", uploadUrl: "https://-cs.com/easyimage/upload/", webSocketUrl: "wss://cs.com/ws", }, // This value must be kept in sync with the language defined in webpack.config.js. language: "zh-cn", };

export default ClassicEditor; ` to need ImportWord CloudServices

vue3 inedx.vue. (A certain page)

yukai3804 avatar Mar 15 '24 07:03 yukai3804

If using online building

image image

yukai3804 avatar Mar 15 '24 10:03 yukai3804

I faced the same issue. It can be reproduced when you don't import the Ckeditor theme CSS files.

Follow this section for how to import the theme.

However, it can be problematic if you want to create your own theme instead of using the default one. In this case, let's wait and see when the team fixes it.

mrdivyansh avatar May 17 '24 10:05 mrdivyansh

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar May 17 '25 23:05 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Jun 17 '25 23:06 CKEditorBot