From 7c2851e958765dc6430a9a99348bdd3c0e38243a Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Sat, 24 Jan 2026 08:18:45 +1100 Subject: [PATCH] fix: refine openExternalUrl to correctly import Tauri shell plugin based on environment --- src/app/utils/tauri.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/utils/tauri.ts b/src/app/utils/tauri.ts index a216d1e..d928b80 100644 --- a/src/app/utils/tauri.ts +++ b/src/app/utils/tauri.ts @@ -3,10 +3,11 @@ * @param url The URL to open */ export const openExternalUrl = async (url: string): Promise => { - if (typeof window !== 'undefined' && (window as any).__TAURI__) { + // Only include Tauri shell import in Tauri builds + // @ts-ignore + if (import.meta.env.VITE_TAURI) { try { - // @ts-ignore - const { open } = await import(/* @vite-ignore */ '@tauri-apps/plugin-shell'); + const { open } = await import('@tauri-apps/plugin-shell'); await open(url); return; } catch (err) {