tauri: macos Blank screen on dev tauri application[bug]

Describe the bug

When I use “cargo tauri dev” to launch the default template project, the interface displays a blank screen, and right-clicking has no response. Upon comparing it with an app that runs correctly, I noticed that it lacks the “xxx Graphics and Media” process. How can I resolve this issue? image

vite.config.js:

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig(async () => ({
  plugins: [vue()],

  // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
  //
  // 1. prevent vite from obscuring rust errors
  clearScreen: false,
  // 2. tauri expects a fixed port, fail if that port is not available
  server: {
    port: 3000,
    strictPort: true,
    host: true,
    watch: {
      // 3. tell vite to ignore watching `src-tauri`
      ignored: ["**/src-tauri/**"],
    },
  },
}));

tauri.conf.json

{
  "build": {
    "beforeDevCommand": "npm run dev",
    "beforeBuildCommand": "npm run build",
    "devPath": "http://0.0.0.0:3000",
    "distDir": "../dist"
  },
  "package": {
    "productName": "sa-evaluation",
    "version": "0.0.0"
  },
  "tauri": {
    "allowlist": {
      "all": false,
      "shell": {
        "all": false,
        "open": true
      }
    },
    "bundle": {
      "active": true,
      "targets": "all",
      "identifier": "com.tauri.dev",
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.icns",
        "icons/icon.ico"
      ]
    },
    "security": {
      "csp": null
    },
    "windows": [
      {
        "fullscreen": false,
        "resizable": true,
        "title": "sa-evaluation",
        "width": 800,
        "height": 600
      }
    ]
  }
}

package.json

{
  "name": "sa-evaluation",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview",
    "tauri": "tauri"
  },
  "dependencies": {
    "vue": "^3.3.4",
    "@tauri-apps/api": "^1.5.2"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.2.3",
    "vite": "^5.0.0",
    "@tauri-apps/cli": "^1.5.8"
  }
}

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.0.0 X64
    ✔ 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-aarch64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 21.5.0
    - yarn: 1.22.21
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.5
    - tauri-cli [RUST]: 1.5.9
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.9

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

Stack trace

No response

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 5
  • Comments: 30 (1 by maintainers)

Most upvoted comments

for my part I ended up buying a new macbook

I’m also on tauri 2. To be more specific:

[✔] Environment
    - OS: Mac OS 15.0.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ 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-aarch64-apple-darwin (default)
    - node: 22.7.0
    - yarn: 1.22.22
    - npm: 10.8.2

I’m using svelte 5 and found these errors:

TypeError: slot_fn is not a function. (In 'slot_fn(anchor, slot_props)', 'slot_fn' is an instance of Object)

	in button.svelte
	in button.svelte
	in SidebarEntry.svelte
	in Sidebar.svelte
	in +layout.svelte
	in root.svelte

Thus, can this bug be related to svelte?

I solve this issue, cargo install wasm-bindgen-cli and cargo install tauri-cli, update the binary, then cargo tauri dev, it works!

not sure where I found it but I managed to improve the startup by adding this to my cargo.toml

[profile.dev.package.scrypt]
opt-level = 3

Turns out that the blank screen is due to the fact that stronghold takes something between 2-3 minutes to boot up without this optimization (at least in dev mode).

My app seems to be fine, but I occasionally get the same error msg as above on my Mac: RemoteLayerTreeDrawingAreaProxyMac::scheduleDisplayLink(): page has no displayID

I’ve recently started getting these as well in Tauri 2.0.2 on MacOS 14.6.1. No errors apart from that.

After I restarted the my computer, it was fixed. I don’t know what happened.

Thanks. @V119, I have the same issue, did you find a fix ?