Issue #3446πŸ’¬ AnsweredOpened May 9, 2021by Spectrevuln-sketch0 reactions

Cannot Store Data Unexpected token '-'

Quick answerby Ju99ernaut

Variable names can't contain '-', so this syntax is invalid:

Read full answer below ↓

Question

Please Help Me, I Want To Store gjs data to mysql but i cannot get any data from front end to back end here my code: const editor = grapesjs.init({ container: "#editor", storageManager: { type: 'remote', params: {}, // For custom values on requests // your SERVER endpoints urlStore: 'http://example.com/store-webpage', urlLoad: 'http://example.com/load-webpage', contentTypeJson: true, setStepsBeforeSave: 1, }, blockManager: { appendTo: "#blocks", }, styleManager: { appendTo: "#styles-container", sectors: [ { name: "Dimension", open: false, buildProps: ["width", "min-height", "padding"], proper...

Answers (4)

Ju99ernautβ€’ May 10, 2021

Variable names can't contain '-', so this syntax is invalid:

const { gjs-assets, gjs-components, gjs-css, gjs-html, gjs-styles } = req.body;
Spectrevuln-sketchβ€’ May 11, 2021

please help i want to store my the template to mysql how i to do it?

Ju99ernautβ€’ May 11, 2021

Unfortunately this may be beyond the scope of grapesjs but some things to note Also since it looks like you're removing the gjs- prefix during storage, you must also add it back during loading. A similar approach is used here https://github.com/Ju99ernaut/gjs-api but for python and postgres.

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @Spectrevuln-sketch. The issue with Cannot Store Data Unexpected token '-' appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state. What to try:...

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.