tauri-apps / tauri

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

[bug] Yew template shows blank on Ubuntu KDE Plasma (Kubuntu) #11166

Open jre0 opened 3 days ago

jre0 commented 3 days ago

Describe the bug

On Linux, with a freshly created Yew template using create-tauri-app, I get a blank screen with no errors and I cannot open the dev tools and the context menu does not show on right click.

I do not want to use Yew but am using it as an error reproduction. When I create an app with the Vanilla template, I got a blank screen initially but I fixed that by adding WEBKIT_DISABLE_DMABUF_RENDERER=1 to my etc/environment. So I don't believe it is a rendering issue. When I load a WASM module in the Vanilla demo, I get the blank screen of death with no context menu or dev tools. So I tried the Yew template which uses WASM and get the same blank screen. So I believe the issue must be about using a WASM module. In the Vanilla template, I can request the WASM module just fine but it goes blank when I try to run a function generated by wasm-bindgen. That might be a clue as to why the Yew template is not working.

I see other people struggling with blank templates and they appear to fix it in regard to an overall WebKit issue. But my problem appears to be with WebAssembly (WASM) in particular. Perhaps the Yew template uses a canvas and webgl and it might be a rendering/driver problem?

Reproduction

I did the following: cargo install create-tauri-app --locked cargo create-tauri-app --rc sudo apt update sudo apt install libwebkit2gtk-4.1-dev \ build-essential \ curl \ wget \ file \ libxdo-dev \ libssl-dev \ libayatana-appindicator3-dev \ librsvg2-dev cargo install trunk --locked cargo tauri dev

Expected behavior

I expect to see the example page.

Full tauri info output

[✔] Environment
    - OS: Ubuntu 24.4.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.3
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 22.6.0
    - npm: 10.8.2

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.2
    - tauri-cli 🦀: 2.0.0-rc.16

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3

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

Stack trace

I'm not sure how to get errors or a stack trace. Everything is green and it also builds to an app image just fine (but shows the blank screen).

Additional context

Screenshot_20240927_093205

ThinkerDreamer commented 3 days ago

This might be the same as #10626, the problem affecting me on Linux Mint 21.3 (based on Ubuntu 22.04 jammy) when I'm trying to run a Leptos / Tauri app in Tauri v2.

Edit: Ah, yeah, sorry, I re-read your issue more closely. I'm also using wasm-bindgen in mine.

For more diagnostics, here's my cargo tauri info


[✔] Environment
    - OS: Linux Mint 21.3.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.3
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.5.1
    - pnpm: 8.9.2
    - npm: 10.2.3

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.1
    - tauri-cli 🦀: 2.0.0-rc.9

[-] Plugins

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
jre0 commented 3 days ago

This might be the same as #10626, the problem affecting me on Linux Mint 21.3 (based on Ubuntu 22.04 jammy) when I'm trying to run a Leptos / Tauri app in Tauri v2.

Edit: Ah, yeah, sorry, I re-read your issue more closely. I'm also using wasm-bindgen in mine.

Thanks for linking to the other issue. It helped me find https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2081166 which I believe to be the root of the problem.

AlexZhu2001 commented 3 days ago

same problem on ArchLinux

Here is my env:

[✔] Environment
    - OS: Arch Linux Unknown x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.0
    ✔ rsvg2: 2.59.0
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (2024-05-07)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 22.9.0
    - pnpm: 9.11.0
    - yarn: 1.22.22
    - npm: 10.8.3

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.2
    - tauri-cli 🦀: 1.5.11
    - @tauri-apps/api : 2.0.0-rc.5
    - @tauri-apps/cli : 2.0.0-rc.16

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1

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

My os info: 图片