Issue #3325Opened March 9, 2021by mmotov0 reactions

BUG: JSON.stringify(this.editor.getComponents()) Error

Question

Version: 0.16.44

Hi there! I have remote storage for pages, and recently I faced an issue when saving page, JSON.stringify(editor.getComponents()) started to throw error Uncaught TypeError: e[M].getId is not a function.

I investigated the already saved JSON representation of the page and found out that it fails on this part

[
  {
    "tagName": "form",
    "type": "form",
    "attributes": {
      "method": "POST",
      "id": "form-id"
    },
    "components": [],
    "__symbol": "if5s0j"
  }
]

I don't know what's the purpose of the __symbol key, but without it, everything works fine. This issue occurs only on few pages, but I'm afraid that it might happen again on other pages.

Answers (3)

yucomdsMarch 9, 20210 reactions

Same error here ... do you have a solution?

[EDIT] Downgrading seems to be the only solution for now

josfh2005March 10, 20210 reactions

Same problem here, if I preprocess the components and remove that attribute (__symbol) before load the Editor the template works fine.

Is the a way @artf to disable the symbols for now?

artfMarch 21, 20210 reactions

Yeah unfortunately the previous version of grapesjs had a bug that created symbols involuntary. In the current version, the bug is fixed and symbols are disabled, but unfortunately, this still happens if you try to load a component with a saved symbol reference (created by the bug). I'll add a patch for this issue in the next release, for now, I'd follow Josè's advice and remove all __symbol references before loading the editor.

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.