Skip to content

[bug] trunk serve causes cargo tauri to rebuild which causes trunk serve to rebuild #160

Description

@kornelski

Describe the bug

If I run cargo tauri dev and trunk serve at the same time, they both watch the same folder for changes, and detect changes to temporary files from the other tool's build, so they both endlessly keep triggering rebuilds.

OTOH If I don't run trunk serve myself, then cargo tauri dev is stuck waiting forever:

Warn Waiting for your frontend dev server to start on http://localhost:1420/...
Warn Waiting for your frontend dev server to start on http://localhost:1420/...
Warn Waiting for your frontend dev server to start on http://localhost:1420/...

Also, when these projects rebuild, they rebuild almost from scratch. I think it's because both end up using the same target/ folder and overwrite each other's build artifacts due to differences in cargo feature flags they use.

Reproduction

npm create tauri-app
# choose cargo and yew
cd the-app
cargo tauri dev 

and then run

trunk serve

in another terminal in the same dir.

Expected behavior

Ideally cargo tauri dev should start the server, so that a separate trunk command is not needed.

Platform and versions

Environment
› OS: Mac OS 12.5.1 X64
› Node.js: 18.8.0
› npm: 8.18.0
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
WARNING: no lock files found, defaulting to npm
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: Not installed!
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,

App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
package.json not found

App directory structure
├─ dist
├─ target
├─ public
├─ src-tauri
├─ .vscode
└─ src

Stack trace

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions