Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

321
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda