Keep getting CORS when using fake endpoint for remote storage
Hi: My solution is: Grapes JS settings storageManager: { type: 'local', autosave: true, stepsBeforeSave: 1, autoload: true, } Request API to get data and save localStorage.setItem ('gjs-html', res.data.html ) localStorage.setItem ('gjs-components', res.data.components ) localStorage.setItem ('gjs-css', res.data.css )...
Read full answer below βQuestion
Hi everyone! I'm using grapesjs with vuejs and I'm struggling with CORS. I created my fake endpoint with beeceptor and I have the code below for editor: It works just fine if I do normal request like post(url, params).then()... but gives out CORS error when I use this.editor.store(). I noticed that grapesjs includes X-Request-With header in the request and I found that you cannot make cross-domain request with it. Is there any way to make the request go thru with my fake store endpoint?
Answers (3)
Hi: My solution is: Grapes JS settings storageManager: { type: 'local', autosave: true, stepsBeforeSave: 1, autoload: true, } Request API to get data and save localStorage.setItem ('gjs-html', res.data.html ) localStorage.setItem ('gjs-components', res.data.components ) localStorage.setItem ('gjs-c...
@Zero-Zheng thanks for the solution! I have to work with remote so is there any way to make remote work with fake endpoint? x( Or is it impossible?
It's up to the endpoint provider to decide if the cross-request is a valid one, GrapesJS (or any client library) has nothing to do with that. Here you can read more about how CORS works https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
Related Questions and Answers
Continue research with similar issue discussions.
Issue #384
Create and Edit Template into Database
This is my code to Create a new template and insert the inline html with style into the database : I am able to insert the template-data in...
Issue #620
Remote Storage
I'm trying to use the remote storage but no success, with the resolved issues I manage to adjust eveything as it best, but editor do not re...
Issue #3071
BUG: update listener triggered on initial load
Hello! I found weird bug with update listener. It's triggered on initial load if html code has <img> tag with class attribute: You can chec...
Issue #3442
Error after call `editor.destroy()`
Create editor instance Try destroy Got error
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
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS vs Webflow vs Tilda (2026): Honest Comparison, Pricing & Which to Pick
GrapesJS vs Webflow vs Tilda compared head-to-head: real 2026 pricing, SEO features, code export, and which one actually fits your project
Tutorial
Preset DevFuture 2.0 β New Update Released
Preset continues evolving as a clean, production-ready starting point for building visual editors powered by GrapesJS
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.