GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

BUG: Upload Image or Asset is not triggering on File/Image selection #5320

Closed SwapnilSoni1999 closed 1 year ago

SwapnilSoni1999 commented 1 year ago

GrapesJS version

What browser are you using?

Chrome v114

Reproducible demo link

none

Describe the bug

How to reproduce the bug?

  1. I'm using grapesjs-react and using assetManager

  2. My config looks like this

    {
                    upload: `${globals.settings.cmsUrl}/upload-image`,
                    uploadName: "image",
                    headers: {
                        Authorization: `Bearer ${token}`,
                    },
                    autoAdd: true,
                    multiUpload: false,
    }

    PS: I do have a working endpoint which I've tested already.

  3. Now goto the editor in browser

  4. add image

  5. select image from the system

  6. then no upload request is made

What is the expected behavior? Expected is it should trigger a request and upload the asset to given url

What is the current behavior? its not uploading anywhere instead its putting base64 image in DOM

Code of Conduct

iamuddeshya commented 1 year ago

Facing same issue

deepanshu-ht commented 1 year ago

++ 1

artf commented 1 year ago

Just tried the same configuration and all works as expected.

Might be related to your grapesjs version or the grapesjs-react itself.

Please avoid creating BUG issues if you're not able to provide a reproducible demo with the latest version of GrapesJS.

I'd also highly recommend switching to the official GrapesJS React wrapper which also allows you to implement a completely declarative custom UI for your editor.