BUG: Unhandled Rejection (TypeError): i.classList is undefined
Question
Hi. I updated GrapesJS to its current version 0.16.22 and I get an error on the callback function:
editor.on("component:add", (model) => {
editor.select(model);
});
The error stack:
Unhandled Rejection (TypeError): i.classList is undefined
Stack:
./node_modules/grapesjs/dist/grapes.min.js/</</w.toggleClass/</<
node_modules/grapesjs/dist/grapes.min.js:2
S
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</w.toggleClass/<
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</w.each/<
node_modules/grapesjs/dist/grapes.min.js:2
S
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</w.each
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</w.toggleClass
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</w.removeClass
node_modules/grapesjs/dist/grapes.min.js:2
updateStatus
node_modules/grapesjs/dist/grapes.min.js:2
m
node_modules/grapesjs/dist/grapes.min.js:2
v
node_modules/grapesjs/dist/grapes.min.js:2
d
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</</o</a.Backbone</c.trigger
node_modules/grapesjs/dist/grapes.min.js:2
set
node_modules/grapesjs/dist/grapes.min.js:2
selectAdd
node_modules/grapesjs/dist/grapes.min.js:11
init/<
node_modules/grapesjs/dist/grapes.min.js:11
m
node_modules/grapesjs/dist/grapes.min.js:2
v
node_modules/grapesjs/dist/grapes.min.js:2
d
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</</o</a.Backbone</c.trigger
node_modules/grapesjs/dist/grapes.min.js:2
_onModelEvent
node_modules/grapesjs/dist/grapes.min.js:2
m
node_modules/grapesjs/dist/grapes.min.js:2
v
node_modules/grapesjs/dist/grapes.min.js:2
d
node_modules/grapesjs/dist/grapes.min.js:2
./node_modules/grapesjs/dist/grapes.min.js/</</</o</a.Backbone</c.trigger
node_modules/grapesjs/dist/grapes.min.js:2
set
node_modules/grapesjs/dist/grapes.min.js:2
add
node_modules/grapesjs/dist/grapes.min.js:2
push
node_modules/grapesjs/dist/grapes.min.js:2
addSelected/<
node_modules/grapesjs/dist/grapes.min.js:11
addSelected
node_modules/grapesjs/dist/grapes.min.js:11
setSelected/<
node_modules/grapesjs/dist/grapes.min.js:11
setSelected
node_modules/grapesjs/dist/grapes.min.js:11
select
node_modules/grapesjs/dist/grapes.min.js:11
Answers (3)
Never mind, problem solved by:
editor.on("load", () => {
editor.on("component:add", (model) => {
editor.select(model);
});
});Ok, never mind the previous never mind. It worked a few times now I'm getting the same error. Sorry about that.
Can you provide a demo, please?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3131
BUG: Paste as plain text into Text component adds <font /> wrapper to pasted text
Version: 0.16.27 Are you able to reproduce the bug from the demo? [] Yes [X] No What is the expected behavior? Paste as plain text (text no...
Issue #1696
Traits appear first time when draged custom component
Hi artf , i have created custom component and add traits for it , when dragging this component to editor and select it the setting traits w...
Issue #4919
BUG: calling destroy method breaks the editor ( React app )
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 109.0.5414.119 Reproducible demo li...
Issue #3444
removeButton() causing error
Hi, I'm trying to remove a button from panel using this code editor.Panels.removeButton('options', 'fullscreen') . It removes the button bu...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.