-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Describe the bug
Using absolute frontendDist path on Windows builds won't embed the assets, instead just links them: file:///D:/some/path/to/dist.
Reproduction
- Set the
frontendDiston Windows to some absolute path, like"frontendDist": "D:\\some\\path\\to\\dist". - Check the parsed config object.
- Note that
frontend_distisSome(Url(Url { scheme: "d", cannot_be_a_base: true, username: "", password: None, host: None, port: None, path: "\\some\\path\\to\\dist", query: None, fragment: None }))instead ofSome(Directory("D:\\some\\path\\to\\dist")). - Run the built application and see the error in the console.
Expected behavior
Absolute path based assets should be embedded properly on Windows, like on Linux and macOS.
Full tauri info output
npm run tauri info
> [email protected] tauri
> tauri info
[✔] Environment
- OS: Mac OS 15.5.0 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ rustc: 1.87.0 (17067e9ac 2025-05-09)
✔ cargo: 1.87.0 (99624be96 2025-05-06)
✔ rustup: 1.28.2 (2025-04-28)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 22.13.1
- npm: 10.9.2
- deno: deno 2.4.3
[-] Packages
- tauri 🦀: 2.7.0
- tauri-build 🦀: 2.3.1
- wry 🦀: 0.52.1
- tao 🦀: 0.34.0
- @tauri-apps/api : not installed!
- @tauri-apps/cli : 2.7.1
[-] Plugins
- tauri-plugin-opener 🦀: 2.4.0
- @tauri-apps/plugin-opener : not installed!
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: d:\some\folder
Stack trace
Additional context
This issue came up when we created a Tauri wrapper package to reuse across multiple projects.
The wrapper package uses a build script to utilise tauri build, and those scripts are creating build specific tauri.conf.json files. The simplest approach was to use absolute paths, but it did not work on Windows, so we switched to relative paths. We also wanted to use our wrapper as a globally installed package on Github actions, where workspaces are on D: and global npm packages are on C:. As a result, our “relative” paths resolved to D:\some\folder\**\* based on the current working directory D:\some\folder, while the global package was located at C:\Users\[Username]\AppData\Roaming\npm\node_modules\our_package.