From 308c98b02ab337cd90aa54956ed856ad1b095a1d Mon Sep 17 00:00:00 2001 From: Camilo Lopez Date: Tue, 12 May 2026 20:46:22 -0500 Subject: [PATCH] fix: frontend failing and go reflex race condition --- reflex.conf | 2 +- ui/dev-dist/registerSW.js | 1 + ui/vite.config.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 ui/dev-dist/registerSW.js diff --git a/reflex.conf b/reflex.conf index 47dd775ab..a5f6183e7 100644 --- a/reflex.conf +++ b/reflex.conf @@ -1 +1 @@ --s -r "(\.go$$|\.cpp$$|\.h$$|navidrome.toml|resources|token_received.html)" -R "(^ui|^data|^db/migrations)" -R "_test\.go$$" -- go run -race -tags netgo,sqlite_fts5 . +-s -r "(\.go$$|\.cpp$$|\.h$$|navidrome.toml|resources|token_received.html)" -R "(^ui|^data|^db/migrations)" -R "_test\.go$$" -- go run -tags netgo,sqlite_fts5 . diff --git a/ui/dev-dist/registerSW.js b/ui/dev-dist/registerSW.js new file mode 100644 index 000000000..1d5625f45 --- /dev/null +++ b/ui/dev-dist/registerSW.js @@ -0,0 +1 @@ +if('serviceWorker' in navigator) navigator.serviceWorker.register('/dev-sw.js?dev-sw', { scope: '/', type: 'classic' }) \ No newline at end of file diff --git a/ui/vite.config.js b/ui/vite.config.js index 9d9c845f1..08f849852 100644 --- a/ui/vite.config.js +++ b/ui/vite.config.js @@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react' import { VitePWA } from 'vite-plugin-pwa' const frontendPort = parseInt(process.env.PORT) || 4533 +const backendHost = process.env.BACKEND_HOST || 'localhost' const backendPort = frontendPort + 100 // https://vitejs.dev/config/ @@ -26,7 +27,7 @@ export default defineConfig({ host: true, port: frontendPort, proxy: { - '^/(auth|api|rest|backgrounds)/.*': 'http://localhost:' + backendPort, + '^/(auth|api|rest|backgrounds)/.*': `http://${backendHost}:${backendPort}`, }, }, base: './',