err_connection_refused help!!

Hey folks! My frontend is deployed on Vercel using Vite and React. My backend is deployed on Railway. When I try to use the chat feature on the live site, I get ERR_CONNECTION_REFUSED in the browser console. The request is being sent to localhost:7000 instead of my Railway backend URL. I have set VITE_API_URL in the Vercel environment variables dashboard and in a .env.production file. I have tried clearing the Vercel build cache, redeploying without cache, and removing .env.local. The latest code is pushed and Vercel shows the deployment as Ready. What could cause this?