tauri: [bug] Blank screen on starting tauri application

Describe the bug

I create a new taur-app with vue scaffolding, but it does not working properly, it shows blank white screen. It seems like https://github.com/tauri-apps/tauri/issues/4638

  1. All resources(js svg and html)loaded, but application’s body is blank. And websocket is fine(with ping message). No error/warning message in console. All elements exists in the html dom. Screenshot from 2022-09-06 16-15-26
  2. When I drage these elements, It shows below. Screenshot from 2022-09-06 16-14-41
  3. Http server works well. Screenshot from 2022-09-06 16-17-04
  4. I tried to run cargo build and cargo build --release, but it seems nothing changed.

Reproduction

  1. Install any missing dependencies.
sudo apt install libwebkit2gtk-4.0-dev \
    build-essential \
    libgtk-3-dev \
    libayatana-appindicator3-dev \
    librsvg2-dev

and I did not run sudo apt update 2. Create Tauri app with pnpm create tauri-app, selecting vite+vue scaffolding. 3. In ${MyAppDir}, run pnpm run install; 4. Run pnpm run tauri dev

Expected behavior

Content appears in window.

Platform and versions

pnpm run tauri info
> test@0.0.0 tauri /home/nvidia/yx/test
> tauri "info"


Environment
  › OS: Ubuntu 18.04 X64
  › Node.js: 18.8.0
  › npm: 8.18.0
  › pnpm: 7.11.0
  › yarn: Not installed!
  › rustup: 1.25.1
  › rustc: 1.63.0
  › cargo: 1.63.0
  › Rust toolchain: stable-aarch64-unknown-linux-gnu

Packages
  › @tauri-apps/cli [NPM]: 1.0.5
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.5,
  › tauri-build [RUST]: 1.0.4,
  › tao [RUST]: 0.12.2,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://127.0.0.1:3000/
  › framework: Vue.js

App directory structure
  ├─ src-tauri
  ├─ dist
  ├─ public
  ├─ node_modules
  ├─ src
  └─ .vscode

package.json

{
  "name": "test",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview",
    "tauri": "tauri"
  },
  "dependencies": {
    "vue": "^3.2.37",
    "@tauri-apps/api": "^1.0.2"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^3.0.1",
    "vite": "^3.0.2",
    "@tauri-apps/cli": "^1.0.5"
  }
}

tauri.conf.json

{
  "build": {
    "beforeDevCommand": "pnpm dev",
    "beforeBuildCommand": "pnpm build",
    "devPath": "http://127.0.0.1:3000",
    "distDir": "../dist",
    "withGlobalTauri": false
  },
  "package": {
    "productName": "test",
    "version": "0.0.0"
  },
  "tauri": {
    "allowlist": {
      "all": true
    },
    "bundle": {
      "active": true,
      "category": "DeveloperTool",
      "copyright": "",
      "deb": {
        "depends": []
      },
      "externalBin": [],
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.icns",
        "icons/icon.ico"
      ],
      "identifier": "com.tauri.dev",
      "longDescription": "",
      "macOS": {
        "entitlements": null,
        "exceptionDomain": "",
        "frameworks": [],
        "providerShortName": null,
        "signingIdentity": null
      },
      "resources": [],
      "shortDescription": "",
      "targets": "all",
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
    "security": {
      "csp": null
    },
    "updater": {
      "active": false
    },
    "windows": [
      {
        "fullscreen": false,
        "height": 600,
        "resizable": true,
        "title": "test",
        "width": 800
      }
    ]
  }
}

Stack trace

No error/warning message.

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 17
  • Comments: 44 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Found a workaround that let me launch my application.

WEBKIT_DISABLE_COMPOSITING_MODE=1 node dev.mjs # or whatever command you use to launch the app

The issue is caused by a WebKitGTK bug, tracked here.

The issue is not related to Tauri and can be closed.

set vite.config.ts#server.host=true, like this

image

@thewh1teagle see my comment here. Tauri cannot do anything to fix this. Luckily, as @Angel-Gonzalez points out, the issue in WebKitGTK seems to be already resolved and we just need to wait for our distros to update though I also suspect that while updating, they might have been switched to Wayland or nvidia_drm.modeset might have been set for them, which could be the real reason it works for them now, would be very curious to confirm this.

The actual reason it works properly with WEBKIT_DISABLE_COMPOSITING_MODE=1, specifically is because, as I assume, it runs the WebKit engine in X11 mode, instead of Wayland, which is, at the moment, supported on more systems.

Setting std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); first on main.rs fixes the blank screen issue on start and also fixes the window resize flicker. But it introduces a new issue where it will show a blank white screen for few milliseconds on start. To fix this, you can add "transparent": true in your tauti.conf.json for the window. This seems to fix the blank screen issue on start as well as page flicker on window resize. Also, if you use SSG framework like Next.js for frontend the static HTML will be loaded immediately into webview. The SPA framework triggering css from javascript might also flash colors for few millis on start. Hope this helps.

I’m having the same issue with the release binary, also notice that resize the window will fix the rendering problem. I apply the workaround at run time by adding std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); at the main function. my environment it’s a raspberry pi 5

I resolved my app with export WEBKIT_DISABLE_COMPOSITING_MODE=1 . Before I setting that environment, I can’t even open the web-view console.

Completed? An env var workaround is not a fix. I think this should stay open until the bug is fixed upstream in WebKit. Or has a WebKit update already been completed elsewhere?

A few days ago the package libwebkit2gtk-4.0-37 was updated to version 2.44.1-1. Since this update, no workaround is needed on my debian bookworm / Raspberry Pi OS. I removed the flag and no issue found. Thanks

@TheRosya’s solution seems to be a kernel parameter, which may be a hard ask for some users - this seems to only effect linux platform, we could check this setting and set the related env variables. Thoughts?

To summarize, so far we have the following possible fixes related to these render issues; export __NV_PRIME_RENDER_OFFLOAD=1 export WEBKIT_DISABLE_COMPOSITING_MODE=1 (kernel param) nvidia_drm.modeset=1

Summarizing symptoms; Blank application window - no objects rendered Blank fonts/Fonts cut off - no fonts rendered Trailing/Clipping - repeating graphical artifacts

WEBKIT_DISABLE_COMPOSITING_MODE=1

I’m noting that on GNOME X11 I need WEBKIT_DISABLE_COMPOSITING_MODE=1,in GNOME Wayland and XFCE (X11) I don’t need it.

That’s the plan but it’s easier said than done. Lots of work for the few maintainers with their very limited time.

Please fix. If enterprise was using this they would lose hundreds of millions of dollars because of this one bug.

WEBKIT_DISABLE_COMPOSITING_MODE=1 doesn’t work for me.

tauri info

[✔] Environment
    - OS: Manjaro 25.0.0 x86_64 (X64) (xfce on x11)
    ✔ webkit2gtk-4.1: 2.46.6
    ✔ rsvg2: 2.59.2
    ✔ rustc: 1.85.1 (4eb161250 2025-03-15)
    ✔ cargo: 1.85.1 (d73d2caf9 2024-12-31)
    ✔ rustup: 1.28.1 (2025-03-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 23.9.0
    - npm: 11.2.0
 [-] Packages
    - tauri 🦀: 2.4.0
    - tauri-build 🦀: 2.1.0
    - wry 🦀: 0.50.5
    - tao 🦀: 0.32.8
    - @tauri-apps/api : 2.3.0 (outdated, latest: 2.4.0)
    - @tauri-apps/cli : 2.4.0
[-] Plugins
    - tauri-plugin-os 🦀: 2.2.1
    - @tauri-apps/plugin-os : 2.2.1
    - tauri-plugin-opener 🦀: 2.2.6
    - @tauri-apps/plugin-opener : 2.2.6
    - tauri-plugin-updater 🦀: 2.6.1
    - @tauri-apps/plugin-updater : not installed!
    - tauri-plugin-single-instance 🦀: 2.2.2
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-fs 🦀: 2.2.0
    - @tauri-apps/plugin-fs : 2.2.0
    - tauri-plugin-shell 🦀: 2.2.0
    - @tauri-apps/plugin-shell : 2.2.0
    - tauri-plugin-clipboard-manager 🦀: 2.2.2
    - @tauri-apps/plugin-clipboard-manager : 2.2.2
    - tauri-plugin-window-state 🦀: 2.2.1
    - @tauri-apps/plugin-window-state : not installed!
    - tauri-plugin-dialog 🦀: 2.2.0
    - @tauri-apps/plugin-dialog : 2.2.0
    - tauri-plugin-log 🦀: 2.3.1
    - @tauri-apps/plugin-log : 2.3.1
[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React

appearance

I found that the HTML element is rendered, but there’s an issue with the CSS. When I disabled the CSS in devtools, the element became visible. I output window.innerHeight in devtools and got a negative number (Infinity).

I’m having this issue. Setting the WEBKIT_DISABLE_COMPOSITING_MODE to 1 doesn’t help.

UPDATE: switched driver to nouveau, still doesn’t work.

Linux ruslanpc 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug  2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

OS: Linux Mint 22 x86_64 
Host: 82K2 IdeaPad Gaming 3 15ACH6 
Kernel: 6.8.0-41-generic 

Resolution: 1920x1080 

DE: Xfce 4.18 
WM: Xfwm4 
WM Theme: Mint-X


AMD Ryzen 5 5600H with Radeon Graphics (12) @ 4.280GHz 

AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
NVIDIA GeForce GTX 1650 Mobile / Max-Q 

When using nVidia drivers on linux the following environment variable must be set to prevent the following errors and blank Tauri window.

export __NV_PRIME_RENDER_OFFLOAD=1

Errors;

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
Failed to create EGL images for DMABufs with file descriptors -1, -1 and -1
WEBKIT_DISABLE_COMPOSITING_MODE=1

I’m noting that on GNOME X11 I need WEBKIT_DISABLE_COMPOSITING_MODE=1,in GNOME Wayland and XFCE (X11) I don’t need it.

I am using XFCE (X11) and I need the workaround to run my app properly.

Mark.

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal

The view is flipped in webkit 1

but normal in the chromium browser.

2

Found a workaround that let me launch my application.

WEBKIT_DISABLE_COMPOSITING_MODE=1 node dev.mjs # or whatever command you use to launch the app

The issue is caused by a WebKitGTK bug, tracked here.

The issue is not related to Tauri and can be closed.

Fixed by set env.

FYI, got the same on Steam Deck earlier, WEBKIT_DISABLE_COMPOSITING_MODE=1 fixed as well