tauri-apps/tauri

[bug] Run Project Tauri + React in Windows 11, the screen display nothing

tung517 opened this issue · 3 comments

Describe the bug

I run a project using Tauri and React, I code in VSCode in normally, one day I run project and run command "npm run tauri dev", the project run the same but the screen I display nothing, I found no error both in Tauri console log and Screen console log

How can I found the cause of this issue
Screenshot 2024-09-25 222604
Screenshot 2024-09-25 214414
Uploading Screenshot 2024-09-25 214811.png…

Screenshot 2024-09-25 214216

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 129.0.2792.52
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.15.0
    - npm: 9.5.0

[-] Packages
    - tauri [RUST]: 1.7.2
    - tauri-build [RUST]: 1.5.4
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - tauri-cli [RUST]: 1.6.0
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.1 (outdated, latest: 1.6.2)

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

Stack trace

No response

Additional context

No response

  • Navigate to the devServer url on your browser and see if it works
  • Make sure that the next server is running on the same port configured in tauri.conf.json.
  • Replace your root React component in main.jsx/main.tsx with a simple <h1> hello world </h1>
  • Comment out your components one by one

If none of these work, please make a minimal repro and I will take a look

  • Navigate to the devServer url on your browser and see if it works
  • Make sure that the next server is running on the same port configured in tauri.conf.json.
  • Replace your root React component in main.jsx/main.tsx with a simple <h1> hello world </h1>
  • Comment out your components one by one

If none of these work, please make a minimal repro and I will take a look

I also have the same issue on tauri 2.0.0-rc.15. My server and GUI were running fine yesterday, and today I encountered this issue when running cargo tauri dev, even though I had made no code changes. I rolled back to old commits and I am still getting the error. The GUI shows on WSL just fine, and I can run cargo tauri build and launch the executable as well. I also followed what you have mentioned in your comment.
The root React component will show hello world when replaced, but when I go back to the main App component, it only shows this:
image

Thanks!

Then I'd try traversing your frontend components commenting one by one until you find the problematic one