-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
Upon upgrading from 7.0.6 to 7.1.0 the behavior of server.proxy.*.target has changed.
Here's a relevant part of my config file:
server: {
proxy: {
'/api': {
target: new URL('/api', 'http://localhost:3000'),
secure: false,
changeOrigin: true,
xfwd: true,
},
},
},
Until 7.0.6, this config resulted in http://localhost:5173/api/*
calls proxied to http://localhost:3000/api/*
.
From 7.1.0, this config results in calls proxied to http://localhost:3000/api/api*
.
Server logs:
# 7.0.6
127.0.0.1 - [2025-09-12T07:05:45.706Z] "GET /api/users/current"
127.0.0.1 - [2025-09-12T07:05:45.737Z] "GET /api/config"
# 7.1.0
127.0.0.1 - [2025-09-12T07:06:01.959Z] "GET /api/api/users/current"
127.0.0.1 - [2025-09-12T07:06:01.984Z] "GET /api/api/config"
Reproduction
https://stackblitz.com/edit/vitejs-vite-utp6hhmk
Steps to reproduce
No response
System Info
Irrelevant - can be reproduced in stackblitz. But...
System:
OS: macOS 15.6
CPU: (10) arm64 Apple M1 Max
Memory: 124.20 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.3.0 - /usr/local/bin/node
Yarn: 4.9.1 - /usr/local/bin/yarn
npm: 11.5.1 - /usr/local/bin/npm
Browsers:
Chrome: 140.0.7339.133
Safari: 18.6
npmPackages:
@vitejs/plugin-basic-ssl: ^2.1.0 => 2.1.0
@vitejs/plugin-react: ^5.0.0 => 5.0.0
vite: 7.1.0 => 7.1.0
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release