Unhandled Rejection (TypeError): i.classList is undefined
Never mind, problem solved by: editor.on("load", () => { editor.on("component:add", (model) => { editor.select(model); }); });
Read full answer below β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: ./nodemodules/grapesjs/dist/grapes.min.js/</</w.toggleClass/</< nodemodules/grapesjs/dist/grapes.min.js:2 S nodemodules/grapesjs/dist/grapes.min.js:2 ./nodemodules/grapesjs/dist/grapes.min.js/</</w.toggleClass/< nodemodules/grapesjs/dist/grapes.min.js:2 ./nodemodules/grapesjs/dist/grapes.min.js/</</w.each/< nodemodules/grapesjs/dist/grapes.min.js:2 S...
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 #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 #3048
[BUG]: TypeError: Cannot read property 'get' of undefined
Version: 0.16.22Are you able to reproduce the bug from the demo? [x] Yes [ ] NoWhat is the expected behavior? no errors in the console.Desc...
Issue #1369
[BUG] Class of a block doesn't always show in the classes section
Hello everyone, I have added many custom blocks and gave the same css class to all the images in those blocks. Let's call it for now 'image...
Issue #2663
[BUG] WASD keypress returns an errror at Canvas
Hi there, I get an error on a keypress at canvas without RTE enabled. Uncaught TypeError: Cannot read property 'hasFocus' of null node_modu...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.