Skip to content

Commit 4a3958a

Browse files
phildenhoffclaude
andauthored
fix: settings window blank in production builds (#120)
The settings window picked its URL by checking whether build.dev_url was present in the config, assuming it is None in release. It is not: the bundled config carries devUrl from tauri.conf.json verbatim, so production builds pointed the settings webview at http://localhost:1420/settings — a Vite dev server that does not exist on user machines. The page never loaded, the frontend reveal never ran, and reopening from the menu showed a permanently blank window. Gate on tauri::is_dev() instead, so release builds always serve the bundled assets via tauri://localhost/settings (the asset protocol falls back to index.html for SPA routes). Verified in a local release build: the settings webview now loads, renders all panes, and shows itself. Also catches Cargo.lock up to the v0.5.0 version bump (#116), which was committed without regenerating the lockfile. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent c212a96 commit 4a3958a

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src-tauri/src/menu.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,20 @@ pub fn open_settings_window<R: Runtime>(app: &AppHandle<R>) {
141141

142142
// In dev, join the Vite dev server URL explicitly; WebviewUrl::App's
143143
// dev-url resolution proved unreliable for secondary windows (the webview
144-
// came up blank). In release, App URLs serve the bundled assets.
145-
let url = match app.config().build.dev_url.clone() {
146-
Some(dev_url) => match dev_url.join("settings") {
147-
Ok(joined) => WebviewUrl::External(joined),
148-
Err(_) => WebviewUrl::App("/settings".into()),
149-
},
150-
None => WebviewUrl::App("/settings".into()),
144+
// came up blank). Gate on is_dev(), not dev_url presence: the bundled
145+
// config still carries devUrl in release, and routing production to the
146+
// (nonexistent) Vite server left the settings window permanently blank
147+
// (CDL-15). In release, App URLs serve the bundled assets.
148+
let url = if tauri::is_dev() {
149+
match app.config().build.dev_url.clone() {
150+
Some(dev_url) => match dev_url.join("settings") {
151+
Ok(joined) => WebviewUrl::External(joined),
152+
Err(_) => WebviewUrl::App("/settings".into()),
153+
},
154+
None => WebviewUrl::App("/settings".into()),
155+
}
156+
} else {
157+
WebviewUrl::App("/settings".into())
151158
};
152159

153160
// Match the webview backing to the app theme (`--ctd-bg` in styles.css)

0 commit comments

Comments
 (0)