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

326
Views
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
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!