grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Invalid JSON String - Load Data

Open michaelreckendorfer opened this issue 8 years ago • 7 comments

I had some problems loading templates. It did not work both the storage in a .json file and the processing in a mysql database.

my loading.php is very simple for testing:

The string was split into individual characters and packaged in an array.

After adjusting the following line everything worked well:

grapes.js - line 42667

       return _this.onResponse (text, clb); to        return _this.onResponse (JSON.parse (text), clb);

I also have the same problem when uploading assets ... here, however, I have not come up with the solution yet.

michaelreckendorfer avatar Jul 21 '18 09:07 michaelreckendorfer

https://grapesjs.com/docs/modules/Storage.html#setup-the-server

artf avatar Jul 25 '18 22:07 artf

I had some problems loading templates. It did not work both the storage in a .json file and the processing in a mysql database.

my loading.php is very simple for testing:

The string was split into individual characters and packaged in an array.

After adjusting the following line everything worked well:

grapes.js - line 42667

       return _this.onResponse (text, clb); to        return _this.onResponse (JSON.parse (text), clb);

I also have the same problem when uploading assets ... here, however, I have not come up with the solution yet.

Can you send your json response ?

suresh5 avatar Dec 07 '18 06:12 suresh5

I am not able to load template reply Can you help me with json format how to send ?

suresh5 avatar Dec 07 '18 06:12 suresh5

Thanks but i already found a solution :) There was a problem with the returning array decoding/encoding

michaelreckendorfer avatar Dec 07 '18 06:12 michaelreckendorfer

Thanks but i already found a solution :) There was a problem with the returning array decoding/encoding

i am fresher to grapesjs. i dont know how to send json response Can you tell me how to send ?

suresh5 avatar Dec 07 '18 06:12 suresh5

I had the same problem. Adding "contentTypeJson: true" to storageManager options solved it.

matosboss avatar Jan 11 '19 17:01 matosboss

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 11 '20 19:01 lock[bot]