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

322
Visualizações
Proxy server with Vite and Axios

I have problem with using proxy when I am trying to run production version of my application. When I use proxy with vite command (development command to start Vite project), It works without problems. I can change target URL and it works. But when I build project with vite build and then run with serve -s dist, It doesnt work.

My axios config: enter image description here

My vite.config.js: enter image description here

Error in console: enter image description here

When I try this with dev script (code), everything works.. I can even change URL with ENV variable and then my frontend using another backend (I have 2 backends live to debug this). It only doesnt work in production mode with command serve -s dist. Any ideas?

I also noticed, that when I change baseUrl in axios config, it works with this url.. so It is something with proxy and production version..

EDIT: I noticed, that requests to that URL ending up with status code 200 OK, but the preview tab in google dev tools is white screen..

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