Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

266
Visualizações
"POST http://localhost:4000/api/upload_file net::ERR_BLOCKED_BY_CLIENT" when post formdata via fetch

I am trying to make file upload app with containerized React & Node.js. I got stuck with the error when I try to upload file. The developer console says like this on the VPS server.

 POST http://localhost:4000/api/upload_file net::ERR_BLOCKED_BY_CLIENT

I built Node.js docker container at http://localhost:4000 and accepts post request to the route /api/upload_file and React container at http://localhost:3000 which accepts get request to the frontend.

My frontend javascript file related to fetch is here.

const TARGET = process.env.TARGET || 'localhost:4000'

export default async function uploadFile(formData) {
  const fetchedData = await fetch(`http://${TARGET}/api/upload_file`, {
    method: 'POST',
    body: formData 
  })
  .then((response) => {
    if (response.ok) {
      return response.json()
    } else {
      throw new Error('Something went wrong')
    }
  })
  .then(res => {
    return { 
      filename: res?.filename
    }
  })
  .catch((error) => {
    console.log(error)
  })
  return fetchedData
} 

I searched for the solutions, but it seems browser's adblocker causes the error... I tried Chrome, Firefox and Brave, and had the same results.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda