This repository was archived by the owner on Mar 19, 2026. It is now read-only.
forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
vite8.0.0-beta.1 Image cross-domain #550
Copy link
Copy link
Description
Describe the bug
In Vite 7, I was able to directly cross-domain access an image under the "src" directory and it worked fine. However, in Vite 8, this is no longer possible.
Even if I set server.cors to true, it still won't work.
Reproduction
Steps to reproduce
- Create the project using the command "pnpm create vue"
- Upgrade to vite 8.0.0-beta.1
- Place a 404.png image under the "src" directory.
- Start the service by running "pnpm run dev"
- Create another HTTP service, and then create an HTML file.
<img src="http://localhost:5173/src/404.png" />System Info
System:
OS: Windows 11 10.0.26100
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
Memory: 21.11 GB / 39.81 GB
Binaries:
Node: 22.18.0 - C:\Users\bpuns\AppData\Local\fnm_multishells\9088_1765350416428\node.EXE
npm: 10.9.3 - C:\Users\bpuns\AppData\Local\fnm_multishells\9088_1765350416428\npm.CMD
pnpm: 10.4.1 - C:\Users\bpuns\AppData\Local\fnm_multishells\9088_1765350416428\pnpm.CMD
Browsers:
Chrome: 143.0.7499.41
Edge: Chromium (140.0.3485.66)Used Package Manager
pnpm
Logs
Cross-origin requests must be made with CORS mode enabled.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels