tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] 在window11 上什么都不显示,就一个大白框

Open DehaiWang opened this issue 1 year ago • 9 comments

Describe the bug

image image

`cargo install create-tauri-app --locked

cargo create-tauri-app

cd appss

cargo tauri dev`

Reproduction

No response

Expected behavior

No response

Platform and versions

D:\works\rustWorks\appss>cargo tauri info
WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 115.0.1901.188
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.71.0 (8ede3aae2 2023-07-12)
    ✔ Cargo: 1.71.0 (cfd3bbd8f 2023-06-08)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 16.14.2
    - yarn: 1.22.18
    - npm: 9.6.7

Stack trace

No response

Additional context

No response

DehaiWang avatar Jul 30 '23 16:07 DehaiWang

  1. 请提供最小可复现案例
  2. 你需要仔细阅读这篇文章

thy486 avatar Jul 31 '23 02:07 thy486

@thy486 我是按照 Quick Start 用的 cargo 和 yarn 的 两种方式, 并未写其他的代码,都尝试了,都是能出来窗口, 但是窗口中未显示内容,仅仅是白框。 我有两台笔记本,其中一台是windows10的能正常显示内容, 在 windows 11的那台笔记本上, http://localhost:1420 在浏览器上能正常显示内容, 但是在 cargo tauri dev 或者 yarn tauri dev 下都是空白的窗口界面。

DehaiWang avatar Jul 31 '23 06:07 DehaiWang

Try modifying the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2]
"RendererCodeIntegrityEnabled"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"RendererCodeIntegrityEnabled"=dword:00000000

Refer to: https://github.com/l1xnan/jupyterlab-desktop/blob/main/src-tauri/src/main.rs#L43C1-L78C1

l1xnan avatar Aug 01 '23 03:08 l1xnan

@l1xnan sorry, not working, not find the Edge in "\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft" image

DehaiWang avatar Aug 01 '23 12:08 DehaiWang

the code is

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}

fn main() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

image

just show blank , and the close button not work yet.

DehaiWang avatar Aug 01 '23 13:08 DehaiWang

@l1xnan sorry, not working, not find the Edge in "\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft" !

The registry key does not exist by default. You need to manually add it

l1xnan avatar Aug 01 '23 14:08 l1xnan

@l1xnan after i add the registry keys, it still show blank . i try Compatibility mode,it works image

DehaiWang avatar Aug 02 '23 05:08 DehaiWang

but one more question, when i code and rtauri dev in windows 11,it still show blank, how to do ?

DehaiWang avatar Aug 02 '23 10:08 DehaiWang

@l1xnan after i add the registry keys, it still show blank . i try Compatibility mode,it works image

The Compatibility mode is the only work solution for me.

I met the blank page problem with the simplest tauri example on Windows 10, and I searched for many solutions, only this reply saved my time... Thanks!

tangramor avatar Jan 30 '24 09:01 tangramor