Issue #3075πŸ’¬ AnsweredOpened October 16, 2020by hellocaio0 reactions

Unhandled Rejection (TypeError): i.classList is undefined

Quick answerby hellocaio

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)

hellocaioβ€’ October 16, 2020

Never mind, problem solved by:

editor.on("load", () => {
    editor.on("component:add", (model) => {
        editor.select(model);
    });
});
hellocaioβ€’ October 16, 2020

Ok, never mind the previous never mind. It worked a few times now I'm getting the same error. Sorry about that.

artfβ€’ October 16, 2020

Can you provide a demo, please?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.