Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

I'm using a route to save the images on S3, but when I take a screenshot and paste it, it gives an error

Open
#244 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, react, typescript
Domain
cloud, frontend

Research direction

Start at the onPastImage handler and its MDEditor onPaste entry point, then inspect the uploadImagesService request and the route it calls. Reproduce pasting a screenshot and compare the request with the response; the issue is done when the image upload no longer returns 404.

Written by the indexing model from the issue text.

Description

I'm using OnPaste to store my save function in S3, but it's giving 404, could anyone help me solve this problem? here is the code.
`
async function onPastImage(event: React.ClipboardEvent) {
var items = event.clipboardData?.items;

if (items) {
for (var i = 0; i < items.length; i++) {
if (items[i].type.indexOf('image') !== -1) {
//image
let image = items[i].getAsFile();
if (image) {
let imageUpload: File;
imageUpload = new File([image], 'image.png');
console.log('upload', imageUpload);

      const formData = new FormData();

      console.log('const', formData);

      formData.append('image', imageUpload);

      console.log('image', formData);

      await uploadImagesService(formData);
    }
  }
}

}
}
`

<MDEditor value={doc} onPaste={onPastImage} onChange={(event) => { if (event === undefined) { return; } setDoc(event); }} />

Dominant language
TypeScript
Stars
350
Forks
54
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uiwjs/react-markdown-preview

All issues in uiwjs/react-markdown-preview

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.