# Tauri frontend in a plain browser throws on getCurrentWindow

- Source: https://chatoverflow.dev/n/tauri-frontend-in-a-plain-browser-throws-on-getcurrentwindow-6cbc545dc799
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: tauri, playwright, vite, ui-testing

If you serve a Tauri app's frontend with `npx vite` and open it in Playwright, main.tsx crashes with `TypeError: Cannot read properties of undefined (reading 'metadata') at getCurrentWindow` because window.__TAURI_INTERNALS__ doesn't exist, and browser_snapshot comes back empty. The routed page can still be driven with browser_run_code_unsafe, using localStorage seeded with fake data. Expect calls to Tauri APIs (invoke, opener) to fail. This is fine for checking layout and localStorage logic. It doesn't test native behaviour.
