Cannot Store Data Unexpected token '-'
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)
Variable names can't contain '-', so this syntax is invalid:
const { gjs-assets, gjs-components, gjs-css, gjs-html, gjs-styles } = req.body;
please help i want to store my the template to mysql how i to do it?
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.
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.
Issue #4191
We are trying to store the data from grapesJS editor in Angular 10 application, getting CORS error, image attached below
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 99.0.4844.5 Reproducible demo link...
Issue #3347
How can I get Uncompressed JS code for me to edit?
Hi, thank you for reviewing my problem. I want to use my own JSEditor to edit htmlγcss and js. 1γFirst, I use getHtml, getCss, getJs to dis...
Issue #3137
When I select an particular element I'm not getting its styles. This issue happens only with some elements.
Not getting styles of the selected element Here is my code, const model = editor.StyleManager.getModelToStyle(component); let styleObject =...
Issue #5000
Localization works weird
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 111 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 βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.