Skip to content

Commit 1f53a2e

Browse files
KevenWMarkhamclaude
andcommitted
fix: set base path to relative for Electron file:// protocol compatibility
Added base: './' to vite config to generate relative asset paths instead of absolute paths. This fixes ERR_FILE_NOT_FOUND errors when loading JavaScript and CSS bundles in Electron apps using file:// protocol. Fixes white screen issue where React app wasn't loading due to 404s on all asset files (index.js, vendor chunks, CSS, registerSW.js). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8722573 commit 1f53a2e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa'
55

66
// https://vite.dev/config/
77
export default defineConfig({
8+
base: './', // Use relative paths for Electron compatibility
89
plugins: [
910
react(),
1011
VitePWA({

0 commit comments

Comments
 (0)