tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
82.37k stars 2.47k forks source link

[bug] tauri dev command uses "frontendDist" instead of "devUrl" #9629

Open physics515 opened 5 months ago

physics515 commented 5 months ago

Describe the bug

I'm building an app using Nuxt 3 and Tauri. I'm on Windows 11.

The build section of my tauri.conf.json looks like this:

"build": {
        "beforeDevCommand": "pnpm dev",
        "devUrl": "http://localhost:3000",
        "beforeBuildCommand": "pnpm generate",
        "frontendDist": ".output/public"
},

When I run the cargo tauri dev command it serves from .output/public thus it doesn't react to changes in the src files.

If I change my tauri.conf.json to this:

"build": {
        "beforeDevCommand": "pnpm dev",
        "devUrl": "http://localhost:3000",
        "beforeBuildCommand": "pnpm generate",
        "frontendDist": "http://localhost:3000"
},

Then it works great.

This seems to have just started after upgrading Tauri CLI from beta.0 to beta.14.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22635 X64
    ✔ WebView2: 124.0.2478.67
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.79.0-nightly (ef8b9dcf2 2024-04-24)
    ✔ cargo: 1.79.0-nightly (c93926759 2024-04-23)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.12.2
    - pnpm: 9.0.6
    - yarn: 1.22.19
    - npm: 10.5.1

[-] Packages
    - tauri [RUST]: 2.0.0-beta.16
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - tauri-cli [RUST]: 2.0.0-beta.14
    - @tauri-apps/api [NPM]: 2.0.0-beta.9
    - @tauri-apps/cli [NPM]: 2.0.0-beta.14

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: http://localhost:3000/
    - devUrl: http://localhost:3000/
    - framework: Vue.js (Nuxt)
    - bundler: Vite

Stack trace

No response

Additional context

No response

amrbashir commented 5 months ago

tauri dev works fine for me with the official templates from crate-tauri-app, Could you please add a reproduction?

physics515 commented 4 months ago

I will try to create a new project tomorrow and see if I can reproduce with a new build.