Unexpected token '<', "<!DOCTYPE "... is not valid JSON in using remote storage #5489
Replies: 1 comment
-
Debug your BE endpoint, you're clearly returning an HTML string instead of a JSON.... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
const editor = grapesjs.init({
container: "#editor",
blockManager: {
appendTo: "#blocks",
},
styleManager: styleManager,
layerManager: layerManager,
traitManager: traitManager,
selectorManager: selectorManager,
panels: panels,
deviceManager: deviceManager,
assetManager: { assets: assets, autosave: false }, // 'upload' option has been removed
storageManager: storageSetting(pageId),
canvas: {
styles: styles,
scripts: scripts,
},
plugins: [
tailwindComponent,
gjsBlockBasic,
swiperComponent,
// grapesjsBlockBootstrap,
grapesjsPluginExport,
grapesjsStyleBg,
chartLibComponent,
grapesjsNavbar,
// grapesjsParserPostcss
],
});
<######## Storage Setting #########>
export const storageSetting = (pageId) => {
const projectApi =
${API_HOST}api/pages/${pageId}/content
return {
type: "remote",
stepsBeforeSave: 1,
contentTypeJson: true,
storeComponents: true,
storeStyles: true,
storeHtml: true,
storeCss: true,
headers: {
"Content-Type": "application/json",
"accept": "application/json"
},
id: "mycustom_",
urlStore: projectApi,
urlLoad: projectApi,
};
};
Note: When I use local storage I don't get any error..

Beta Was this translation helpful? Give feedback.
All reactions