question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image Tool: uploading failed because of Object

See original GitHub issue

I am using editor js and the image module with Javascript. The image button appears on the editor on my page, however, it will not fully upload the photo. I get the message “cannot upload an image. Try another.” In the console, I get the following message:

Screenshot 2021-05-25 144925

I cannot find anywhere online that gives a solution to this issue. Here is my code in the HTML body, please tell me what is going wrong:

<script>
    const ImageTool = window.ImageTool;
</script>

<script>
    const editor = new EditorJS({
        holder: 'editorjs',
        tools: {
            image: {
                class: ImageTool,
                config: {
                    endpoints: {
                        byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
                        byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
                    }
                }
            }
        }
    })
</script>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
neSpecccommented, May 26, 2021

Can you show your server response?

1reaction
98sarthakjaincommented, May 30, 2021

SAME ISSUE!!!

@app.route("/upload-image", methods=["GET", "POST"])
def upload_image():
    if request.method == "POST":
        if request.files:
            image = request.files["image"]
            image.save(os.path.join(app.config["IMAGE_UPLOADS"], image.filename))
            print("Image saved")
            return jsonify({ "success" : 1,"file": {
        "url" : "https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg",
    }})
    return render_template("public/upload_image.html")

<> JS image: { class: ImageTool, config: { endpoints: { byFile: ‘http://127.0.0.1:5000/upload-image/’, // Your backend file uploader endpoint byUrl: ‘http://127.0.0.1:5000/upload-image/’, // Your endpoint that provides uploading by Url } },

Read more comments on GitHub >

github_iconTop Results From Across the Web

@editorjs/image, "Can't upload image. Please try another." ...
In the console, "POST HTTP://localhost:3000/ 404 (Not Found)" and, "Image Tool: uploading failed because of" and a body object. See the attached screenshot ......
Read more >
editorjs image plugin return image url is not picked up
I configured editorjs into my application. I installed image plugin on it so that I can upload an image to the server.
Read more >
editorjs/image
Image Tool. Image Block for the Editor.js. Features. Uploading file from the device; Pasting copied content from the web; Pasting images by ...
Read more >
Upload image in editor.js & understanding the ... - YouTube
Upload image in editor.js & understanding the concept of deleting unused file ... An error occurred while retrieving sharing information.
Read more >
Image uploads: unsupported items
When uploading .svg or .dxf files into Cricut Design Space, you may receive the following error message: "Your file includes unsupported items.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found