Skip to content

[bug] When I Use tauri-plugin-http and reqwest either, I got a panic #138274

Description

@Wan9xy

Code

just follow next steps

  • create a new project
D:\src>cargo create-tauri-app
✔ Project name · http3-test
✔ Identifier · com.http3-test.app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, deno, bun)
✔ Choose your package manager · yarn
✔ Choose your UI template · React - (https://react.dev/)
✔ Choose your UI flavor · TypeScript

Template created! To get started run:
  cd http3-test
  yarn
  yarn tauri android init

For Desktop development, run:
  yarn tauri dev

For Android development, run:
  yarn tauri android dev
  • add http-plugin
PS D:\src\http3-test> cargo tauri add http
    Info Installing Cargo dependency "tauri-plugin-http"...
    Updating crates.io index
      Adding tauri-plugin-http v2 to dependencies                                                                                                                                                                                                                                                             
             Features as of v2.0.0:
             + charset
             + cookies
             + http2
             + macos-system-configuration
             + rustls-tls
             - blocking
             - brotli
             - deflate
             - gzip
             - json
             - multipart
             - native-tls
             - native-tls-alpn
             - native-tls-vendored
             - rustls-tls-manual-roots
             - rustls-tls-native-roots
             - rustls-tls-webpki-roots
             - socks
             - stream
             - trust-dns
             - unsafe-headers
    Updating crates.io index
     Locking 14 packages to latest compatible versions                                                                                                                                                                                                                                                        
      Adding atomic-waker v1.1.2
      Adding cookie_store v0.21.1
      Adding core-foundation v0.9.4
      Adding data-url v0.3.1
      Adding document-features v0.2.11
      Adding h2 v0.4.8
      Adding litrs v0.4.1
      Adding psl-types v2.0.11
      Adding publicsuffix v2.3.0
      Adding system-configuration v0.6.1
      Adding system-configuration-sys v0.6.0
      Adding tauri-plugin-fs v2.2.0
      Adding tauri-plugin-http v2.3.0
      Adding tokio-macros v2.5.0
    Info Installing NPM dependency "@tauri-apps/plugin-http@>=2"...
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\csstype\LICENSE'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\react\LICENSE'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\csstype\index.js.flow'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\react\index.js'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\rollup\dist\shared\index.js.DELETE.b9028c845ffc584fbb068805a7d58e0a'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\react-dom\cjs\react-dom-server.browser.development.js.DELETE.76960b8d49de689888a42ede9c85b4e1'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\react-dom\umd\react-dom-server.browser.development.js.DELETE.1d650941dcfc97f45f5af66203d98360'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\@types\react\index.d.ts.DELETE.6c7871ba6cbe85ffe9516d2f2b26e620'
    Added permission `http:default` to `default` at D:\src\http3-test\src-tauri\capabilities\default.json
    Info Adding plugin to D:\src\http3-test\src-tauri\src/lib.rs
    Info Running `cargo fmt`...
  • add reqwest
PS D:\src\http3-test> cd .\src-tauri\
PS D:\src\http3-test\src-tauri> cargo add reqwest --features http3
    Updating crates.io index
      Adding reqwest v0.12.12 to dependencies                                                                                                                                                                                                                                                                 
             Features:
             + __rustls
             + __rustls-ring
             + __tls
             + charset
             + default-tls
             + h2
             + http2
             + http3
             + macos-system-configuration
             + rustls-tls-manual-roots
             + rustls-tls-manual-roots-no-provider
             22 deactivated features
     Locking 21 packages to latest compatible versions
      Adding errno v0.3.10
      Adding fastrand v2.3.0
      Adding foreign-types v0.3.2
      Adding foreign-types-shared v0.1.1
      Adding futures v0.3.31
      Adding h3 v0.0.6
      Adding h3-quinn v0.0.7
      Adding hyper-tls v0.6.0
      Adding linux-raw-sys v0.4.15
      Adding native-tls v0.2.14
      Adding openssl v0.10.71
      Adding openssl-macros v0.1.1
      Adding openssl-probe v0.1.6
      Adding openssl-sys v0.9.106
      Adding rustix v0.38.44
      Adding schannel v0.1.27
      Adding security-framework v2.11.1
      Adding security-framework-sys v2.14.0
      Adding tempfile v3.17.1
      Adding tokio-native-tls v0.3.1
      Adding vcpkg v0.2.15
  • last setting env and run you can get panic like this
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `commands::fetch::{closure#0}`
#1 [layout_of] computing layout of `{async fn body of commands::fetch<R>()}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `commands::fetch`
#3 [analysis] running analysis passes on this crate
end of query stack
  • at last my cargo.toml is
[package]
name = "http3-test"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "http3_test_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-http = "2"
reqwest = { version = "0.12.12", features = ["http3"] }

Meta

rustc --version --verbose:

OS: Windows 11 x64
rustc: rustc 1.84.1 (e71f9a9a9 2025-01-27)

Error output


error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `commands::fetch::{closure#0}`
#1 [layout_of] computing layout of `{async fn body of commands::fetch<R>()}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `commands::fetch`
#3 [analysis] running analysis passes on this crate
end of query stack

Activity

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

Metadata

Metadata

Labels

A-async-awaitArea: Async & AwaitA-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-coercionsArea: implicit and explicit `expr as Type` coercionsA-dyn-traitArea: trait objects, vtable layoutC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityS-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions