-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Describe the bug
When a custom base is set in the vite config, browser tests fail to load /custom-base/@vite/client.
This error doesn't show up in the cli, but it does show up in the browser's console.
It doesn't seem to affect tests though, afaict.
Setting '/' for tests only fixes the issue.
const isTest = process.env.NODE_ENV === 'test';
export default defineConfig({
base: isTest ? '/' : '/custom-base/',Reproduction
export default defineConfig({
base: '/custom-base/',
// ...
test: {
browser: {
enabled: true,
name: 'chromium',
provider: 'playwright',
headless: false
}
}
});Not minimal, but you can also reproduce with this repo:
https://github.com/adazzle/react-data-grid/blob/main/vite.config.ts#L11
System Info
System:
OS: Windows 11 10.0.22631
CPU: (64) x64 AMD Ryzen Threadripper 3970X 32-Core Processor
Memory: 16.97 GB / 31.88 GB
Binaries:
Node: 22.8.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.22621.3527
npmPackages:
@vitejs/plugin-react: ^4.3.1 => 4.3.1
@vitest/browser: ^2.1.1 => 2.1.1
@vitest/coverage-v8: ^2.1.1 => 2.1.1
@vitest/eslint-plugin: ^1.1.4 => 1.1.4
vite: ^5.4.5 => 5.4.5
vitest: ^2.1.1 => 2.1.1Used Package Manager
npm
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.
- 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.
