Hi, I'm working on a poc where I have to build a tauri app as a shared library (expected to be loaded and run from another app).
So I build it using classic cargo build --release --lib (note the --release flag).
The thing is, when I load it and run it from another binary, also built with --release, the app window seems to run in “development mode” because it's white blank with the following error message
Could not connect: Connection refused
In my tauri.conf.json I have this (the app use vite + TS setup for frontend)
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420",
"distDir": "../dist",
"withGlobalTauri": false
},
As soon I update devPath property to use the static build assets path "../dist" it fix the issue and it works.
But that corroborates my doubts: When running the app from a runner application, tauri app loaded as a shared lib (built in release mode), the window is running in dev mode and it shouldn't.
Because devPath is used instead of distDir.
Describe the bug
Hi, I'm working on a poc where I have to build a tauri app as a shared library (expected to be loaded and run from another app). So I build it using classic
cargo build --release --lib
(note the--release
flag).The thing is, when I load it and run it from another binary, also built with
--release
, the app window seems to run in “development mode” because it's white blank with the following error messageIn my
tauri.conf.json
I have this (the app use vite + TS setup for frontend)As soon I update
devPath
property to use the static build assets path"../dist"
it fix the issue and it works. But that corroborates my doubts: When running the app from a runner application, tauri app loaded as a shared lib (built inrelease
mode), the window is running in dev mode and it shouldn't. BecausedevPath
is used instead ofdistDir
.How can I fix this issue?
Reproduction
https://github.com/nymtech/tauri_lib
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response