tauri-apps / tauri

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

[bug] "process.env.TAURI_ENV_PLATFORM" is undefined by command "pnpm tauri ios dev" #8484

Closed guobaorou-man closed 8 months ago

guobaorou-man commented 9 months ago

Describe the bug

Command "pnpm tauri ios dev" can't get the process.env.TAURI_ENV_PLATFORM correctly. Command "pnpm tauri android dev" works.

vite vite.config.ts

print ios terminal print for ios

print android terminal print for android

Did I got something wrong?

Reproduction

No response

Expected behavior

No response

Full tauri info output

> tauri "info"

[✔] Environment
    - OS: Mac OS 14.2.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.74.1 (a28077b28 2023-12-04)
    ✔ cargo: 1.74.1 (ecb9851af 2023-10-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 17.9.1
    - pnpm: 8.9.2
    - npm: 8.11.0

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.20
    - tauri-build [RUST]: 2.0.0-alpha.13
    - wry [RUST]: 0.35.1
    - tao [RUST]: 0.24.0
    - @tauri-apps/api [NPM]: 2.0.0-alpha.13
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.20

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

[-] iOS
    - Developer Teams: ** * (ID: *******)

Stack trace

No response

Additional context

No response

amrbashir commented 8 months ago

Should be fixed in latest release