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]Axios sends request but cannot get result #9535

Closed
yIllusionSky opened this issue Apr 22, 2024 · 3 comments
Closed

[bug]Axios sends request but cannot get result #9535

yIllusionSky opened this issue Apr 22, 2024 · 3 comments
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@yIllusionSky
Copy link

Describe the bug

I have configured cross-domain on the server backend, and axios obtains requests normally in cargo tauri dev and cargo tauri android dev. I do not use the route of vite for cross-domain, but directly get the results through axios target url. . But when I use cargo tauri android build, I cannot jump on the login page (normally it is a jump), and Axios cannot get any resources.

I am using tauri2.0-beta.13, the latest version of rustc nightly, and the front end uses bun.

Reproduction

axios cannot return request

Expected behavior

axios return request

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0-nightly (dbce3b43b 2024-04-20)
    ✔ cargo: 1.79.0-nightly (80d5b607d 2024-04-19)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: nightly-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - bun: 1.0.36

[-] Packages
    - tauri [RUST]: 2.0.0-beta.15
    - tauri-build [RUST]: 2.0.0-beta.12
    - wry [RUST]: 0.39.1
    - tao [RUST]: 0.27.0
    - tauri-cli [RUST]: 2.0.0-beta.13
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; img-src 'self' data:;; connect-src ipc: http://ipc.localhost
    - frontendDist: ../dist
    - devUrl: http://localhost:5173/
    - framework: Vue.js
    - bundler: Vite

[-] iOS
    - Developer Teams: None

Stack trace

No response

Additional context

No response

@yIllusionSky yIllusionSky added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 22, 2024
@muwoo
Copy link

muwoo commented Apr 22, 2024

Try use tauri http request

@GaryCraft
Copy link

Try use tauri http request

this will fix the issue, as tauri does not allow the embedded browser to make requests directly
also configure the project permissions to allow requests to the required urls
Read further

@yIllusionSky
Copy link
Author

Try use tauri http request

Try use tauri http request

this will fix the issue, as tauri does not allow the embedded browser to make requests directly also configure the project permissions to allow requests to the required urls Read further

Thank you! Following your advice, the problem has been solved.

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

No branches or pull requests

4 participants