Summary
In web/LAN mode (pnpm lan), the dashboard renders a blank page. The bundle throws before React can mount.
Console error
Uncaught TypeError: Cannot read properties of undefined (reading 'metadata')
at Sr (main-*.js)
Cause
src/App.tsx:63 calls getCurrentWindow() at module scope:
const appWindow = getCurrentWindow();
getCurrentWindow() dereferences window.__TAURI_INTERNALS__.metadata.currentWindow.label, which only exists inside the Tauri shell. In a plain browser __TAURI_INTERNALS__ is undefined, so module evaluation throws and nothing renders.
Every one of the 7 call sites is already guarded with isTauriRuntime() — only the declaration itself is not.
Reproduce
pnpm lan
# open http://localhost:3210 -> blank page
Suggested fix
Resolve it lazily so the module can evaluate outside Tauri:
let appWindowRef: ReturnType<typeof getCurrentWindow> | null = null;
const appWindow = () => (appWindowRef ??= getCurrentWindow());
then update the 7 call sites to appWindow()..
Related: the minimize/maximize/close buttons at src/App.tsx:1285 are gated only on !isMacOs, so they render in the browser too and throw when clicked. They could take an isTauriRuntime() check as well.
Version: v0.2.12
Summary
In web/LAN mode (
pnpm lan), the dashboard renders a blank page. The bundle throws before React can mount.Console error
Cause
src/App.tsx:63callsgetCurrentWindow()at module scope:getCurrentWindow()dereferenceswindow.__TAURI_INTERNALS__.metadata.currentWindow.label, which only exists inside the Tauri shell. In a plain browser__TAURI_INTERNALS__isundefined, so module evaluation throws and nothing renders.Every one of the 7 call sites is already guarded with
isTauriRuntime()— only the declaration itself is not.Reproduce
pnpm lan # open http://localhost:3210 -> blank pageSuggested fix
Resolve it lazily so the module can evaluate outside Tauri:
then update the 7 call sites to
appWindow()..Related: the minimize/maximize/close buttons at
src/App.tsx:1285are gated only on!isMacOs, so they render in the browser too and throw when clicked. They could take anisTauriRuntime()check as well.Version: v0.2.12