Issue #5131๐Ÿ’ฌ AnsweredOpened May 20, 2023by sdimitrenco0 reactions

After JSON.stringify Components have not all fields

Quick answerby artf

If the property is of the same value as the default definition, it's skipped. This is controlled by avoidDefaults config option and it's highly recommended to keep it true to have small JSONs as possible.

Read full answer below โ†“

Question

GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? ChromeReproducible demo link https://jsfiddle.net/sdimitrenco/rn8u4pc0/7/Describe the bug I'm not sure it's a bug or not, but for me, behavior look strange I have a component List that includes, component ol and component li. That code for block That model for the component list That model for the ol component And the model for the li component As you can see all models include types and tag Names, and inside grapes it work correct, but if I try convert it to json, like JSON.stringify(this.grapesIns...

Answers (2)

artfโ€ข May 22, 2023

If the property is of the same value as the default definition, it's skipped. This is controlled by avoidDefaults config option and it's highly recommended to keep it true to have small JSONs as possible.

GJS Helperโ€ข May 17, 2026

This behavior is not a bug but an intentional optimization within GrapesJS, which leverages Backbone.js models. When you serialize GrapesJS components to JSON, attributes that match their default values for that specific component type are often omitted to reduce the size of the serialized data. Ro...

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 โ†’

Related tutorials

In-depth guides on the same topic.

All tutorials โ†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.