-
-
Notifications
You must be signed in to change notification settings - Fork 190
Description
Related plugins
Describe the bug
Hello π
It seems like the base option with Vite results in invalid chunk loading in browser environment:
For /src/client.tsx request goes to http://localhost:5173/examplesrc/client.tsx - while debugging I found this:
| return __vite_rsc_raw_import__(import.meta.env.BASE_URL + id.slice(1)) |
It seems like there's a slice(1) call for some reason. If I locally patched it to remove the slice - it works correctly, but I'm not sure why it was there in the first place π
I hope my investigation is helpful, thanks a lot in advance!
Reproduction
https://github.com/pawelblaszczyk5/rsc-base-reproduction
Steps to reproduce
- Start with RSC default starter
- Add
baseoption tovite.config.ts - Run dev server, observe the error of loading client chunk in browser
System Info
System:
OS: macOS 15.5
CPU: (8) arm64 Apple M1 Pro
Memory: 130.72 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.4.0 - ~/.local/state/fnm_multishells/2224_1752770938234/bin/node
npm: 11.4.2 - ~/.local/state/fnm_multishells/2224_1752770938234/bin/npm
pnpm: 10.13.1 - ~/.local/state/fnm_multishells/2224_1752770938234/bin/pnpm
bun: 1.1.33 - ~/.bun/bin/bun
Browsers:
Chrome: 138.0.7204.101
Edge: 120.0.2210.121
Safari: 18.5
npmPackages:
@vitejs/plugin-react: latest => 4.6.0
@vitejs/plugin-rsc: latest => 0.4.12
vite: ^7.0.4 => 7.0.5Used Package Manager
pnpm
Logs
N/A here
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.
- 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.