-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Hi, I am just starting with Tauri.. I am having an issue with multiple apps, when i am running multiple apps in dev mode, all the apps are sharing the same ui, instead of its own ui.. What i noticed was all the apps frontend communicates to the same server, which is nothing but the first server started while running the first app.. Also the other apps, which are started after first app failing to start app server with following error..
error binding to 127.0.0.1:1430..
looks like tauri always uses a static server config..
Is there anyway we can set the server host & port while running cargo tauri dev
Something like below should help
cargo tauri dev --host <host-ip/name> --port <port-no>
Reproduction
- Create 2 or more tauri apps using
cargo create-tauri-app - Go ahead & update one of the apps' index.html so that it is now same from the other ones.
- Now start the apps one by one, in dev mode
cargo tauri dev.
We will always see the same ui rendered for all the apps, also check console for the below error for all the apps started after first app.
error binding to 127.0.0.1:1430..
Since the port is already bind to first app server, starting from 2nd app the servers failed to start and clients start rendering the ui content from first app.
Expected behavior
Expect to see the ui specific to the app, also either server should start with different port instead of static one or we should have option of starting the server with different port as below.
cargo tauri dev --host <host-ip/name> --port <port-no>
Platform and versions
Environment
› OS: Mac OS 13.1.0 X64
› Node.js: 16.18.0
› npm: 8.19.2
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.25.2
› rustc: 1.67.0
› cargo: 1.67.0
› Rust toolchain: stable-aarch64-apple-darwin
Packages
WARNING: no lock files found, defaulting to npm
› @tauri-apps/cli [NPM]: 1.2.3
› @tauri-apps/api [NPM]: Not installed!
› tauri [RUST]: 1.2.4,
› tauri-build [RUST]: 1.2.1,
› tao [RUST]: 0.15.8,
› wry [RUST]: 0.23.4,
App
› build-type: bundle
› CSP: unset
› distDir: ../src
› devPath: ../src
package.json not found
App directory structure
├─ src-tauri
├─ .vscode
└─ src
Stack trace
thread '<unnamed>' panicked at 'error binding to 127.0.0.1:1430: error creating server listener: Address already in use (os error 48)', /Users/prabhugopal/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.23/src/server/server.rs:79:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Info Watching /Users/prabhugopal/Learning/tauri/hello-next/src-tauri for changes...
Compiling hello-next v0.0.0 (/Users/prabhugopal/Learning/tauri/hello-next/src-tauri)
Finished dev [unoptimized + debuginfo] target(s) in 1.24sAdditional context
No response