Error codes
CKEditor 5 Framework logs errors and warnings to the console. The following list contains more detailed descriptions of those issues.
-
The editor passed to
attachToForm()
must implement theElementApi
interface. -
Cannot get elements with the same id for an attribute element without id.
-
The attribute with given key already exists for the given node.
Parameters
node : Node
key : String
-
The range to change is not flat.
-
Changed node has different attribute value than operation's old attribute value.
Parameters
item : Item
key : String
value : *
-
Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may cause some unexpected behaviour and inconsistency between the DOM and the view. This may be caused by:
- calling
change
orrender
during rendering process, - calling
change
orrender
inside of post-fixer function.
- calling
-
This error is thrown when the
CKEDITOR_VERSION
global is being set more than once. This happens when in two scenarios described above.Some packages were duplicated
CKEditor 5 was built from source packages which were duplicated during installation via npm. Normally, npm deduplicates all packages so e.g.
@ckeditor/ckeditor5-core
is installed only once innode_modules/
. However, subsequentnpm install
calls or conflicting version dependencies may cause npm to install some packages more than once. Furthermore, npm in version 5+ is also known for randomly failing to deduplicate packages.We recommend checking if any of the below steps helps:
rm -rf node_modules && npm install
to make sure you have a cleannode_modules/
– this step is known to help in majority of cases,- check whether all CKEditor 5 packages are up to date and reinstall them
if you changed anything (
rm -rf node_modules && npm install
), - downgrade npm to version 4 if you use a newer version.
If all packages are correct and compatible with each other the above steps are known to help. If not, you may try to check with
npm ls
how many times@ckeditor/ckeditor5-core
is installed. If more than once, verify which package causes that.Two+ builds are loaded
If you use CKEditor 5 builds, you might have loaded two (or more)
ckeditor.js
files in one web page – check your web page for duplicated<script>
elements or make sure your page builder/bundler includes CKEditor only once.Parameters
collidingVersion : String
The version of the build which has already been (incorrectly) loaded.
version : String
The version of the build which is supposed to be loaded.
-
This item's id should be a string.
-
This item already exists in the collection.
-
The index number has invalid value.
-
The collection cannot be bound more than once.
-
Index or id must be given.
-
Item not found.
-
Command does not exist.
Parameters
commandName : String
Name of the command.
-
The item already exists in the component factory.
Parameters
name : String
The name of the component.
-
The required component is not registered in the component factory. Please make sure the provided name is correct and the component has been correctly added to the factory.
Parameters
name : String
The name of the missing component.
-
Trying to add configuration of the same view more than once.
-
Trying to remove configuration of the view not defined in the stack.
-
This error occurs when a text node's attribute is to be downcasted by
Attribute to Attribute converter
. In most cases it is caused by converters misconfiguration when only "generic" converter is defined:editor.conversion.for( 'downcast' ).add( downcastAttributeToAttribute( { model: 'attribute-name', view: 'attribute-name' } ) );
and given attribute is used on text node, for example:
model.change( writer => { writer.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 ); } );
In such cases, to convert the same attribute for both
Element
andText
nodes, text specificAttribute to Element converter
with higher priority must also be defined:conversion.for( 'downcast' ).add( downcastAttributeToElement( { model: { key: 'attribute-name', name: '$text' }, view: ( value, writer ) => { return writer.createAttributeElement( 'span', { 'attribute-name': value } ); }, converterPriority: 'high' } ) );
-
Trying to add a converter to an unknown dispatchers group.
-
Trying to register a group name that was already registered.
-
Cannot detach document node.
-
Only operations with matching versions can be applied.
Parameters
operation : Operation
-
Restoring gravity for an unknown UID is not possible. Make sure you are using a correct UID obtained from the
overrideSelectionGravity
to restore.Parameters
uid : String
The unique identifier returned by
overrideGravity
.
-
Range from document selection starts or ends at incorrect position.
Parameters
range : Range
-
Cannot update the source element of a detached editor.
The
updateSourceElement()
method cannot be called if you did not pass an element toEditor.create()
. -
You need to enable an upload adapter in order to be able to upload files.
This warning shows up when
FileRepository
is being used without definining an upload adapter.If you see this warning when using one of the CKEditor 5 Builds it means that you did not configure any of the upload adapters available by default in those builds.
See the comprehensive "Image upload overview" to learn which upload adapters are available in the builds and how to configure them.
If you see this warning when using a custom build there is a chance that you enabled a feature like
ImageUpload
, orImageUploadUI
but you did not enable any upload adapter. You can choose one of the existing upload adapters listed in the "Image upload overview".You can also implement your own image upload adapter.
-
Insertion position is invalid.
-
LivePosition's root has to be an instance of RootElement.
-
Cannot use a destroyed marker instance.
-
Merge operation specifies wrong number of nodes to move.
-
Merge source position is invalid.
-
Merge target position is invalid.
-
Model#createPositionAt()
requires the offset to be specified when the first parameter is a model item. -
A root with the specified name already exists.
Parameters
doc : Document
name : String
-
The node's parent does not contain this node.
This error may be thrown from corrupted trees.
-
Given offset cannot be found in the node list.
Parameters
offset : Number
nodeList : NodeList
Stringified node list.
-
You can not make a position after a root element.
Parameters
root : Item
-
You can not make a position before a root element.
Parameters
root : Item
-
Cannot create position for document. Root with specified name does not exist.
Parameters
rootName : String
-
Position parent have to be a model element or model document fragment.
-
Position path must be an array with at least one item.
Parameters
path
-
Position root is invalid.
Positions can only be anchored in elements or document fragments.
-
Cannot set selection focus if there are no ranges in selection.
-
Cannot set selection to given place.
-
selection.setTo requires the second parameter when the first parameter is a node.
-
Given
length
value is incorrect. -
Given
offsetInText
value is incorrect. -
Neither boundaries nor starting position of a
TreeWalker
have been defined. -
Trying to move a range of nodes into one of nodes from that range.
-
The nodes which should be moved do not exist.
-
Source position or target position is invalid.
-
Trying to move a range of nodes into the middle of that range.
-
Given index cannot be found in the node list.
-
Trying to insert an object which is not a Node instance.
-
Properties must be unique.
-
Binding multiple observables only possible with callback.
-
Cannot bind the same property more that once.
-
Cannot bind multiple properties and use a callback in one binding.
-
Binding one attribute to many observables only possible with one attribute.
-
Invalid argument syntax in
to()
. -
The number of properties must match.
-
All properties must be strings.
-
Cannot override an existing property.
This error is thrown when trying to set an property with a name of an already existing property. For example:
let observable = new Model(); observable.property = 1; observable.set( 'property', 2 ); // throws observable.set( 'property', 1 ); observable.set( 'property', 2 ); // ok, because this is an existing property.
-
Properties must be strings.
-
Cannot decorate an undefined method.
Parameters
object : Object
The object which method should be decorated.
methodName : String
Name of the method which does not exist.
-
Trying to move a range which starts and ends in different element.
-
Trying to remove a range which starts and ends in different element.
-
The message must be a string.
-
It was not possible to load the plugin.
This is a generic error logged to the console when a JavaSript error is thrown during the initialization of one of the plugins.
If you correctly handled the promise returned by the editor's
create()
method (like shown below) you will find the original error logged to the console, too:ClassicEditor.create( document.getElementById( 'editor' ) ) .then( editor => { // ... } ) .catch( error => { console.error( error ); } );
Parameters
plugin : String
The name of the plugin that could not be loaded.
-
Two plugins with the same
pluginName
were loaded. This will lead to runtime conflicts between these plugins.In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build. Plugins should always be added to a source version of the editor (
@ckeditor/ckeditor5-editor-*
), not to an editor imported from one of the@ckeditor/ckeditor5-build-*
packages.Check your import paths and the list of plugins passed to
Editor.create()
or specified inEditor.builtinPlugins
.The second option is that your
node_modules/
directory contains duplicated versions of the same CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages innode_modules/
, so it may be enough to callrm -rf node_modules && npm i
. However, if you installed conflicting versions of packages, their dependencies may need to be installed in more than one version which may lead to this warning.Technically speaking, this error occurs because after adding a plugin to an existing editor build dependencies of this plugin are being duplicated. They are already built into that editor build and now get added for the second time as dependencies of the plugin you are installing.
Read more about installing plugins.
Parameters
pluginName : String
The duplicated plugin name.
plugin1 : function
The first plugin constructor.
plugin2 : function
The second plugin constructor.
-
Some plugins are not available and could not be loaded.
Plugin classes (constructors) need to be provided to the editor before they can be loaded by name. This is usually done in CKEditor 5 builds by setting the
builtinPlugins
property.If you see this warning when using one of the CKEditor 5 Builds, it means that you try to enable a plugin which was not included in that build. This may be due to a typo in the plugin name or simply because that plugin is not a part of this build. In the latter scenario, read more about custom builds.
If you see this warning when using one of the editor creators directly (not a build), then it means that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a "plugin loader". This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to provide each plugin through reference (as a constructor function). Check out the examples in "Building from source".
Parameters
plugins : Array.<String>
The name of the plugins which could not be loaded.
-
Cannot load a plugin because one of its dependencies is listed in the
removePlugins
option.Parameters
plugin : function
The required plugin.
requiredBy : function
The parent plugin.
-
At least one range has to be passed to
Range.\_createFromRanges()
. -
The
Rect
class depends ongetBoundingClientRect
andgetClientRects
DOM methods. If the source of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods will fail to obtain the geometry and the rect instance makes little sense to the features using it.To get rid of this warning make sure the source passed to the constructor is a descendant of
window.document.body
.Parameters
source : String
The source of the Rect instance.
-
Element to change has different name than operation's old name.
-
Given position is invalid or node after it is not instance of Element.
-
Unknown type passed to Renderer.markToSync.
-
The attribute with given key already exists for the given node.
Parameters
root : RootElement
key : String
-
The element to change is not a root element.
Parameters
root : RootElement
key : String
value : *
-
The attribute which should be removed does not exists for the given node.
Parameters
root : RootElement
key : String
value : *
-
Cannot create RootAttributeOperation for document. Root with specified name does not exist.
Parameters
rootName : String
-
The node after the merge position must be an element.
-
The node before the merge position must be an element.
-
Selection change observer detected an infinite rendering loop. Most probably you try to put the selection in the position which is not allowed by the browser and browser fixes it automatically what causes
selectionchange
event on which a loopback through a model tries to re-render the wrong selection and again. -
Graveyard position invalid.
-
Split operation specifies wrong number of nodes to move.
-
Split position is invalid.
-
Cannot split root element.
-
There was a problem processing the configuration of the toolbar. The item with the given name does not exist so it was omitted when rendering the toolbar.
This warning usually shows up when the
Plugin
which is supposed to provide a toolbar item has not been loaded or there is a typo in the configuration.Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration is correct, e.g.
Bold
is loaded for the'bold'
toolbar item.You can use the following snippet to retrieve all available toolbar items:
Array.from( editor.ui.componentFactory.names() );
Parameters
name : String
The name of the component.
-
The number of children in extended definition does not match.
-
Attempting to revert a template which has not been applied yet.
-
Node definition cannot have the "tag" and "text" properties at the same time. Node definition must have either "tag" or "text" when rendering a new Node.
-
This View has already been rendered.
-
All event names must be strings.
-
Incorrect conversion result was dropped.
Model range should be a conversion result.
-
View#createPositionAt()
requires the offset to be specified when the first parameter is a view item. -
View document is already set. It can only be set once.
-
Cannot add children to
EmptyElement
. -
Before focusing view document, selection should be placed inside one of the view's editables. Normally its selection will be converted from model document (which have default selection), but when using view document on its own, we need to manually place selection before focusing it.
-
The node's parent does not contain this node. It means that the document tree is corrupted.
-
You can not make a position after a root.
Parameters
root : Node
-
You cannot make a position before a root.
Parameters
root : Node
-
The inline filler node was lost. Most likely, something overwrote the filler text node in the DOM.
-
Selection range set to an object that is not an instance of
Range
. -
Cannot set selection focus if there are no ranges in selection.
-
Cannot set selection to given place.
-
selection.setTo requires the second parameter when the first parameter is a node.
-
Given length value is incorrect.
-
Given offsetInText value is incorrect.
-
Neither boundaries nor starting position have been defined.
-
Cannot add children to
UIElement
. -
Trying to break an element which is not a container element.
-
Trying to break root element.
-
Cannot break inside EmptyElement instance.
-
Cannot break inside UIElement instance.
-
Inserted nodes should be valid to insert. of AttributeElement, ContainerElement, EmptyElement, UIElement, Text.
-
Position's parent container cannot be found.
-
Range container is invalid. This can happen if range start and range end positions are not placed inside same container or parent container for these positions cannot be found.
-
Element before and after given position cannot be merged.
-
Attribute element need to be instance of attribute element.
-
Attribute element need to be instance of attribute element.
-
Class and style attributes should be handled separately in
ViewConsumable#add()
.What you have done is trying to use:
consumables.add( { attributes: [ 'class', 'style' ] } );
While each class and style should be registered separately:
consumables.add( { classes: 'some-class', styles: 'font-weight' } );
-
Toolbar with the given id was already added.
Parameters
toolbarId
Toolbar id.
-
Marker with provided name already exists.
-
Range parameter is required when adding a new marker.
-
The
options.usingOperations
parameter is required when adding a new marker. -
Trying to use a writer outside a
change()
or {@link module:engine/model/model~Model#enqueueChangeenqueueChange()
blocks.The writer can only be used inside these blocks which ensures that the model can only be changed during such "sessions".
-
Node after merge position must be an element.
-
Node before merge position must be an element.
-
Range is going to be moved within not the same document. Please use insert instead.
-
Invalid range to move.
-
Range to move is not flat.
-
Trying to remove marker which does not exist.
-
Trying to rename an object which is not an instance of Element.
-
Element with no parent can not be split.
-
Trying to unwrap an element which has no parent.
-
Marker with provided name does not exists.
-
One of the options is required - provide range, usingOperations or affectsData.
-
Element to wrap with is already attached to a tree model.
-
Element to wrap with is not empty.
-
Range to wrap is not flat.