Issue #3354Opened March 22, 2021by ThetripGr1 reactions

BUG: having two instances of grape present makes the asset manager of the first "stop" working

Question

Version: 0.16.44

What is the expected behavior?

I expect to have 2 separate instances of grape in one single page and being able to utilize the asset manager properly

Describe the bug detailed

I have initialized 2 instances of grape in a page with the config below

ar editor = grapesjs.init({
		fromElement: 1,
		container: "#{{varName}}",
		plugins: [...],
		styleManager: false,
	       noticeOnUnload: false,
	       storageManager: false,
               panels: {...},
               assetManager: {
			upload: '/api/handleEditorUpload',
			uploadName: 'files',
		},

what happens is that in the second instance of the editor, the asset manager is working fine. On the contrary on the first instance the asset manager seems to be kind of broken. In the image below, you can see what is shown when I try to use the asset manager on the first instance. Here I have uploaded an image but it is nowhere to be seen.

image

BUT the image seems to be handled on the asset manager of the other instance as well as all other images already uploaded...

image

there is no error to be seen either. Any idea why this could be happening?

UPDATE this seems to be an issue with setting the assetManager on the init config of the editor if I comment out the asseManager: {..} part, suddenly the editor behaves as expected. How can I config this property and have it working ? I need to do the image handling myself.

Answers (1)

ThetripGrMarch 22, 20211 reactions

OK so after a little bit more investigating, the real issue was due to how I was initiating the editors so my bad. I wasn't making sure the instances were truly separate and I was overwritting the first instance even though it appeared as normal without errors. I close this issue as it not a real bug report.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.