Grapes.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined
Thanks for the report, the fix is ready for the next release.
Read full answer below โQuestion
I got this error when add the <iframe src="https://app.conversiobot.com/boot/fvMEvO" width="100%" height="500" frameBorder="0" allow="geolocation"></iframe> used the custom code component. my code works fine with 0.17.4, but got below error with 0.17.19 grapes.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined at r.loadTraits (grapes.min.js:2) at r.initTraits (grapes.min.js:2) at r.initialize (grapes.min.js:2) at r.e.Model (grapes.min.js:2) at r [as constructor] (grapes.min.js:2) at r [as constructor] (grapes.min.js:2) at r [as constructor] (grapes.min.js:2) at new r (gra...
Answers (3)
Thanks for the report, the fix is ready for the next release.
I am encountering a similar issue with v0.19.5 when I try to add an iframe inside of a custom code block
Thanks for reporting this, @jcsofts. The error TypeError: Cannot read property 'length' of undefined occurs when Canvas attempts to access properties before the component lifecycle is fully initialized. This is a common race condition in GrapesJS. Immediate workaround: If you control the code, wrap...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5378
Uncaught TypeError: Cannot read properties of undefined (reading 'Canvas') while dragging a component in Layer Manager Panel
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v116.0.5845.97 Reproducible demo li...
Issue #3794
RTE Overlapping text In Basic Text Component when Width & Height are 100% of Canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 93.0.4577.82 (Official Build) (64-...
Issue #6086
Cannot read properties of undefined (reading 'lastComponent') & resizable feature not work
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Edge v128Reproducible demo linkshttps://code...
Issue #4837
HTML elements ids are incremented on different pages loaded in projectData
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Firefox 109 Reproducible demo link https:/...
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 โRelated tutorials
In-depth guides on the same topic.
Tutorial
Vanilla GrapesJS vs GrapesJS With Plugins: What You Actually Get Out of the Box (2026)
New to GrapesJS? See exactly what the stock editor gives you, where it falls short, and which plugins close the gaps โ a beginner-friendly 2026 comparison
Tutorial
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners โ this post is for you.
Tutorial
How We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.