Wrong Type for "content" property in BlockProperties
You've accurately identified a discrepancy between the GrapesJS documentation and its TypeScript type definitions for the content property within BlockProperties. This is indeed a bug in the type definition, as the content property is designed to accept more flexible values than currently declared in Block.ts. Root Ca...
Read full answer below โQuestion
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122 Reproducible demo link not applicable Describe the bug The GrapeJs Docs indicate that it is possible to add mixed content to the "content" property of a block (see https://grapesjs.com/docs/modules/Blocks.html#mixed). But the type definition for the property is 'string | ComponentDefinition' (see https://github.com/GrapesJS/grapesjs/blob/dev/src/block_manager/model/Block.ts#L17). This leads to errors during compiling in TypeScript Projects. How to reproduce the bug?define Block propert...
Answers (1)
You've accurately identified a discrepancy between the GrapesJS documentation and its TypeScript type definitions for the content property within BlockProperties. This is indeed a bug in the type definition, as the content property is designed to accept more flexible values than currently declared...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6250
Clone page prompt 'Converting circular structure to JSON'
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome 129.0.6668.101Reproducible demo link...
Issue #5175
Move method is not working as expected
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Issue #5503
ReplaceWith method doesn't have string type
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link none Describ...
Issue #4384
Index.d.ts says that components must be Backbone.Collection<Component> but the docs say Component[] is also accepted
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? AnyReproducible demo link https://grapesjs.c...
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
Claude Skill for GrapesJS: How AI Is Changing the Way We Build Visual Editors
We've released the Claude Skill for GrapesJS Development โ a free, open-source skill that turns Claude into a developer who actually knows GrapesJS
Tutorial
Lighthouse for GrapesJS: Audit Accessibility and SEO Without Leaving the Editor
Live WCAG 2.1/2.2 accessibility auditor + SEO manager for GrapesJS. Every finding is bound to the exact component โ click to select, then one-click fix.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins โ TinyMCE Inline Text Editor and Placeholder.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.