You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: have the editor loading without any errors
What happens instead: I get a 404 error when the editor is appending styles
I'm getting the following error on the console after the editor is started: mixins.js:27 GET http://example.com/editor/null net::ERR_ABORTED 404 (Not Found)
I replaced the real domain with "example.com", the rest of the URL is real.
On mixins.js, line 27, the instruction is head.insertBefore(link, head.firstChild);, it's part of the function that append styles to the editor. The problem is I'm passing an array of valid URLs, all of them resolve correctly as I see each style applied to the editor's html.
Here's how I'm creating the editor:
var editorSettings = {
fromElement: true,
height: '900px',
width: '600px',
cssIcons: null,
storageManager: { type: null },
noticeOnUnload: false,
panels: { defaults: [] },
canvas: {
styles: [
'https://fonts.googleapis.com/css?family=Libre+Franklin:400,600,700&display=swap',
'https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css',
'/wp-content/plugins/votersguide/public/css/pageTemplate.css?version=1.0.26'
]
},
assetManager: {
storageType : '',
storeOnChange : true,
storeAfterUpload : true,
assets : [],
uploadFile: function(e) {
var postHash = getUrlVars()['g'];
var nonce = $('#wpNonce').val();
var files = e.dataTransfer ? e.dataTransfer.files : e.target.files;
var formData = new FormData();
for(var i in files){
formData.append('file-'+i, files[i]) //containing all the selected images from local
}
formData.append('action', 'votersguide_editor');
formData.append('g', postHash);
formData.append('nonce', nonce);
$.ajax({
url: myAjax.ajaxurl,
type: 'POST',
data: formData,
contentType: false,
crossDomain: true,
dataType: 'json',
mimeType: "multipart/form-data",
processData:false,
success: function(result){
var myJSON = [];
$.each( result['data'], function( key, value ) {
myJSON[key] = value;
});
var images = myJSON;
editor.AssetManager.add(images); //adding images to asset manager of GrapesJS
}
});
},
},
};
editorSettings.container = '#'+selectedPage.attr('id');
var editor = grapesjs.init(editorSettings);
The text was updated successfully, but these errors were encountered:
First of all, thank you for this great tool.
I'm getting the following error on the console after the editor is started:
mixins.js:27 GET http://example.com/editor/null net::ERR_ABORTED 404 (Not Found)
I replaced the real domain with "example.com", the rest of the URL is real.
On mixins.js, line 27, the instruction is
head.insertBefore(link, head.firstChild);
, it's part of the function that append styles to the editor. The problem is I'm passing an array of valid URLs, all of them resolve correctly as I see each style applied to the editor's html.Here's how I'm creating the editor:
The text was updated successfully, but these errors were encountered: