tauri-apps / tauri

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

[bug] Shell command added to scope cannot be run in 1.7 #10207

Closed billyjacoby closed 3 months ago

billyjacoby commented 3 months ago

Describe the bug

After upgrading my app from Tauri version 1.5 to 1.7 my shell commands cannot be executed with the error

TheShellmodule is not enabled. You must enable one of its APIs in the allowlist.

I've confirmed that the scopes are defined properly, and changing the tauri.conf.json.tauri.allowList.all property to true has allowed the command to be run, but I don't think that should be needed.

Reproduction

https://github.com/billyjacoby/browsernaut/tree/chore/dep-upgrades

This branch compared to the current main branch on the repo has the issue, while main works as expetced.

Expected behavior

No response

Full tauri info output

yarn tauri info

[✔] Environment
    - OS: Mac OS 15.0.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.72.0 (5680fa18f 2023-08-23)
    ✔ cargo: 1.72.0 (103a7ff2e 2023-08-15)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 20.12.2
    - yarn: 4.0.1
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.7.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App


### Stack trace

_No response_

### Additional context

_No response_
FabianLars commented 3 months ago

The error is correct, this is how it was always meant to be. The scope config alone should not enable the apis themselves. For that you'll need shell.all or shell.execute

billyjacoby commented 3 months ago

Ahhh got it, thanks a ton for the clairifcation!