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] can't compile tauri for development #10172

Closed
SamuNatsu opened this issue Jul 2, 2024 · 9 comments
Closed

[bug] can't compile tauri for development #10172

SamuNatsu opened this issue Jul 2, 2024 · 9 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@SamuNatsu
Copy link

Describe the bug

cannot find type Command in module crate::api::process

failed to resolve: could not find Encoding in process

problem occurred on latest Tauri v1.7.0 while I'm creating a new tauri project on Win11 using command pnpm create tauri-app

same problem as #9728, and I've tried to update cargo dependencies, but nothing helpful

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 126.0.2592.81
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.15.0
    - pnpm: 9.5.0-beta.0
    - npm: 10.8.1

[-] Packages
    - tauri [RUST]: 1.7.0
    - tauri-build [RUST]: 1.5.3
    - 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
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

Compiling tauri v1.7.0
error[E0412]: cannot find type `Command` in module `crate::api::process`
   --> C:\Users\*****\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-1.7.0\src\endpoints\shell.rs:244:41
    |
244 | ) -> super::Result<crate::api::process::Command> {
    |                                         ^^^^^^^ not found in `crate::api::process`
    |
help: consider importing this struct
    |
7   + use std::process::Command;
    |
help: if you import `Command`, refer to it directly
    |
244 - ) -> super::Result<crate::api::process::Command> {
244 + ) -> super::Result<Command> {
    |

error[E0433]: failed to resolve: could not find `Encoding` in `process`
   --> C:\Users\*****\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-1.7.0\src\endpoints\shell.rs:304:50
    |
304 |     if let Some(encoding) = crate::api::process::Encoding::for_label(encoding.as_bytes()) {
    |                                                  ^^^^^^^^ could not find `Encoding` in `process`
    |
help: consider importing this struct
    |
7   + use encoding_rs::Encoding;
    |
help: if you import `Encoding`, refer to it directly
    |
304 -     if let Some(encoding) = crate::api::process::Encoding::for_label(encoding.as_bytes()) {
304 +     if let Some(encoding) = Encoding::for_label(encoding.as_bytes()) {
    |

   Compiling vswhom v0.1.0
   Compiling embed-resource v2.4.2
   Compiling tauri-winres v0.1.1
   Compiling tauri-build v1.5.3
Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `tauri` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Additional context

No response

@SamuNatsu SamuNatsu added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jul 2, 2024
@yuqiang-yuan
Copy link

The same. And my tauri info is:

yarn tauri info                                                                                                                     ✔  base   17:08:04 
yarn run v1.22.19
$ tauri info

[✔] Environment
    - OS: Mac OS 14.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.19.0
    - pnpm: 7.26.2
    - yarn: 1.22.19
    - npm: 10.2.3

[-] Packages
    - tauri [RUST]: 1.7.0
    - tauri-build [RUST]: 1.5.3
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - tauri-cli [RUST]: 1.5.11
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite
✨  Done in 7.17s.

@FabianLars
Copy link
Member

pr is up, thanks for the report.

@yq612
Copy link

yq612 commented Jul 2, 2024

same ques

@gabrielalexandrelopes
Copy link

Is there a way to revert to the previous version of tauri? I tried changing the version in the Cargo.toml but no success.

@doums
Copy link

doums commented Jul 2, 2024

@gabrielalexandrelopes you have to reset Cargo.lock as well

@gabrielalexandrelopes
Copy link

gabrielalexandrelopes commented Jul 2, 2024

@doums I started from scratch:

cargo install create-tauri-app --locked --force
cargo create-tauri-app
cd tauri-app
cargo tauri dev

but I'm still getting the same error. How can I reset? rm the lock file? (sorry I'm a beginner in rust)

@FabianLars
Copy link
Member

Alternatively just wait 10-20 minutes for CI to be done releasing the fix :)

Then you can run cargo update in your src-tauri dir and it should pull in the fix (or create a new project)

@gabrielalexandrelopes
Copy link

Sounds good, thanks @FabianLars !

@SamuNatsu
Copy link
Author

problem solved on tauri v1.7.1

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

6 participants