tauri-apps / tauri

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

[bug] Initial content doesn't render inside app macOS #7153

Open cskwrd opened 1 year ago

cskwrd commented 1 year ago

Describe the bug

After executing cargo create-tauri-app and selecting rust/yew, the default content doesn't render inside the application window.

Reproduction

  1. cargo install create-tauri-app
  2. cargo create-tauri-app
    • Select Rust
    • Select yew
  3. cd new-tauri-app
  4. cargo tauri dev

Expected behavior

Application window opens and default template content is rendered.

Platform and versions

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Mac OS 10.15.7 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.70.0 (90c541806 2023-05-31)
    ✔ Cargo: 1.70.0 (ec8a8a0ca 2023-04-25)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 16.14.0
    - yarn: 1.22.10
    - npm: 8.3.1

[-] Packages
    - tauri [RUST]: 1.3.0
    - tauri-build [RUST]: 1.3.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: not installed!
    - @tauri-apps/cli [NPM]: 1.3.1

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/

### Stack trace

```text
`Unhandled Promise Rejection: Error: WebAssembly.Module doesn't parse at byte 273`

Additional context

No response

FabianLars commented 1 year ago

Thanks for the report! This looks like something we should ask the yew devs about since i see the same issue in plain safari 13.1 :thinking:

cskwrd commented 1 year ago

Is there a way to change the version of safari used? When I navigate to the yew frontend in safari 15.6.1, the page renders fine.

FabianLars commented 1 year ago

Only by updating macOS itself.

cskwrd commented 1 year ago

Any ideas why I would see different behavior between the tauri app window and safari proper then?

FabianLars commented 1 year ago

Well, different webkit/safari versions. The webview on macOS is basically Safari 13 and that can only be updated via OS updates. Maybe yew uses some feature that wasn't available in Safari 13.

jwatte commented 9 months ago

FWIW, this seems to be bigger than just Yew. I'm using solidjs and any reload event or additional window event (like "alert('hi')") will not render on macos while developing. If I tab to another workspace and back, then it renders the window, so this feels like the rust-level host of the webview isn't doing the right thing.

seongs1024 commented 8 months ago

Same here with Leptos.

[✔] Environment
    - OS: Mac OS 10.15.7 X64
    - Safari: Version 15.6.1 (15613.3.9.1.16, 15613)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.75.0 (82e1608df 2023-12-21)
    ✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.11.1
    - pnpm: 8.15.3
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.2
    - tauri-build [RUST]: 2.0.0-beta.1
    - wry [RUST]: 0.35.2
    - tao [RUST]: 0.25.0
    - tauri-cli [RUST]: 2.0.0-beta.1
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/

Using Leptos alone fine, Tauri fine, Merging both, WASM initialization is failed.

Unhandled Promise Rejection: Error: WebAssembly.Module doesn't parse at byte 209: invalid opcode 195, in function at index 3