Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] tauri build ignores --debug argument #11768

Closed
Phippe opened this issue Nov 21, 2024 · 7 comments
Closed

[bug] tauri build ignores --debug argument #11768

Phippe opened this issue Nov 21, 2024 · 7 comments
Labels
status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug

Comments

@Phippe
Copy link

Phippe commented Nov 21, 2024

Describe the bug

I wanted to debug the release build of my app using devtools, so I ran the command listed here, but it simply created a normal release build. I can't open any devtools, neither by right-clicking and inspecting nor pressing F12.

As far as I remember, this command used to work on Tauri 1.x.

Reproduction

  1. Start a new project with npm create tauri-app@latest and install all the packages
  2. Run npm run tauri build -- --debug

A normal release build will be created in the src-tauri/target/release/bundle directory. A src-tauri/target/debug/bundle folder on the other hand doesn't even exist.

Expected behavior

According to the docs, a new debug build should be created in src-tauri/target/debug/bundle, allowing the use of devtools.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22621 x86_64 (X64)
    ✔ WebView2: 130.0.2849.80
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.11.0
    - pnpm: 8.15.5
    - npm: 10.5.0

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

No response

@Phippe Phippe added status: needs triage This issue needs to triage, applied to new issues type: bug labels Nov 21, 2024
@FabianLars
Copy link
Member

can you show the terminal messages when you run npm run tauri build -- --debug ? This command should still work in v2.

@Phippe
Copy link
Author

Phippe commented Nov 21, 2024

PS D:\phili\dev\debug-build-bug> npm run tauri build -- --debug

> [email protected] tauri
> tauri build

    Running beforeBuildCommand `npm run build`

> [email protected] build
> tsc && vite build

vite v5.4.11 building for production...
 6 modules transformed.
dist/index.html                 8.36 kB  gzip: 3.46 kB
dist/assets/index-pSGieOOU.css  1.37 kB  gzip: 0.65 kB
dist/assets/index-DdG3jFR9.js   1.11 kB  gzip: 0.59 kB
 built in 183ms
   Compiling debug-release-build v0.1.0 (D:\phili\dev\debug-build-bug\src-tauri)
    Finished `release` profile [optimized] target(s) in 50.01s
    Built application at: D:\phili\dev\debug-build-bug\src-tauri\target\release\debug-release-build.exe
    Info Target: x64
    Running candle for "main.wxs"
    Running light to produce D:\phili\dev\debug-build-bug\src-tauri\target\release\bundle\msi\debug-release-build_0.1.0_x64_en-US.msi
    Info Target: x64
    Running makensis.exe to produce D:\phili\dev\debug-build-bug\src-tauri\target\release\bundle\nsis\debug-release-build_0.1.0_x64-setup.exe
    Finished 2 bundles at:
        D:\phili\dev\debug-build-bug\src-tauri\target\release\bundle\msi\debug-release-build_0.1.0_x64_en-US.msi
        D:\phili\dev\debug-build-bug\src-tauri\target\release\bundle\nsis\debug-release-build_0.1.0_x64-setup.exe

@FabianLars
Copy link
Member

thanks. Can you also share the scripts section in package.json?

@Phippe
Copy link
Author

Phippe commented Nov 21, 2024

Should be short enough, so here's the whole package.json in case anything else is needed:

{
  "name": "debug-release-build",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview",
    "tauri": "tauri"
  },
  "dependencies": {
    "@tauri-apps/api": "^2",
    "@tauri-apps/plugin-shell": "^2"
  },
  "devDependencies": {
    "@tauri-apps/cli": "^2",
    "vite": "^5.3.1",
    "typescript": "^5.2.2"
  },
  "packageManager": "[email protected]+sha1.a58c038faac410c947dbdb93eb30994037d0fce2"
}

@FabianLars
Copy link
Member

and tauri dev still works fine? If not then something like a .cargo/config.toml that somehow forces release mode (if that exists) could have been possible, but if that works i really have no idea what the issue could be.
Maybe try updating npm, or try yarn or pnpm?

Right now you're the only person with this issue so there has to be something system specific i can't think of here 🤔

@Phippe
Copy link
Author

Phippe commented Nov 21, 2024

So, I've just tried different versions of Node and found some success with older versions:

  • 18: works
  • 20: works
  • 22: doesn't work (version I was using)
  • 23: doesn't work

(tauri dev works fine, if this is still of relevance now)

@FabianLars
Copy link
Member

There seem to be more people with the problem in the npm repo.

Mentioned workarounds include npm run tauri build "--" --debug and npm run tauri build -- -- --debug

I still wonder why this seems to be only affecting a handful of users 🤔

@FabianLars FabianLars added status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes and removed status: needs triage This issue needs to triage, applied to new issues labels Nov 21, 2024
@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug
Projects
None yet
Development

No branches or pull requests

2 participants