fix(desktop): inline STREAMS_URL at build time to fix packaged app crash#1367
Conversation
STREAMS_URL was missing from the Vite define block, so the bundled app still referenced process.env.STREAMS_URL at runtime where it's undefined.
📝 WalkthroughWalkthroughAdds STREAMS_URL environment variable injection to the Electron build configuration with a default value of "https://superset-stream.fly.dev", and makes the variable optional in the main process environment schema with the same default fallback. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
STREAMS_URLwas missing from the Vitedefineblock inelectron.vite.config.ts, so the bundled.asarstill contained a rawprocess.env.STREAMS_URLreference that resolves toundefinedat runtime on users' machinesdefineChanges
electron.vite.config.ts— Addprocess.env.STREAMS_URLto themain.defineblock with production fallbackenv.main.ts— Add.default()to the Zod schema as a safety netTest Plan
bun run build --filter=@superset/desktop)Summary by CodeRabbit