Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
How to fix this "AxiosError" in my React app?

I'm trying to upload a new image in my react app, but when I send the request, the result is this error:

error   Object { message: "Unsupported source URL: undefined" }

My snippet of code is this:

const handleCreate = async () => {
        const data = new FormData();
        data.append("file", file);
        data.append("upload_preset", "uploads");
        try {
          const uploadRes = await axios.post(
            "https://api.cloudinary.com/v1_1/CLOUDNAME/image/upload",
            data
          );
    
        const { url } = uploadRes.data;
        const newProduct = {
          title,
          desc,
          prices,
          extraOptions,
          img: url,
        };

        await axios.post("http://localhost:3000/api/products", newProduct);
        setClose(true);

        } catch (err) {
          console.log(err);
        }
      };
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!