tauri-apps / tauri

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

[bug] Tauri App not running on Windows 11 #4203

Closed jquesada2016 closed 2 years ago

jquesada2016 commented 2 years ago

Describe the bug

When creating a new tauri app, running npx tauri dev builds and opens a window, but does not show anything and displays an error in the console. The error can be found in the Stack Trace section of this report.

Reproduction

  1. On Windows 11, create a new tauri project however one wishes
  2. run npx tauri dev or with the rust cli
  3. wait for the window to open and watch the ensuing blank screen and errors

Expected behavior

I expect tauri to open the window as normal with no errors and display the web app's contents.

Platform and versions

Environment
  › OS: Windows 10.0.22000 X64
  › Webview2: 101.0.1210.53
  › MSVC: 
      - Visual Studio Build Tools 2022
  › Node.js: 17.7.1
  › npm: 8.5.2
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.11
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.0-rc.11,
  › tauri-build [RUST]: 1.0.0-rc.9,
  › tao [RUST]: 0.8.5,
  › wry [RUST]: 0.16.2,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http://localhost:3000/
  › framework: Svelte

App directory structure
  ├─ .svelte-kit
  ├─ node_modules
  ├─ src
  ├─ src-tauri
  ├─ static
  └─ tests

Stack trace

Compiling app v0.1.0 (C:\Dev\Commercial\manteados-grecia\sistema-procesos\src-tauri)
    Finished dev [unoptimized + debuginfo] target(s) in 4.52s
     Running `target\debug\app.exe`
[0524/105510.088:ERROR:validation_errors.cc(106)] Invalid message: VALIDATION_ERROR_UNEXPECTED_NULL_POINTER ([0524/105510.088:ERROR:interface_endpoint_client.cc(665)] Message 1283517667 rejected by interface embedded_browser.mojom.EmbeddedBrowser


### Additional context

I came across this error when I was teaching a friend how to use Tauri. They were on Windows 10, and did not have any issues. I, however did, as stated above.
amrbashir commented 2 years ago

Do you still have this issue? Can't reproduce it. Please post a minimal repro if you still encounter this.

lucasfernog commented 2 years ago

Looks similar to https://github.com/MicrosoftEdge/WebView2Feedback/issues/1207 and #4181

jquesada2016 commented 2 years ago

I took a look at #4181 and it is definitely related. Here's a bit more context:

I made a sort of screen reader app for myself that is always running in the background. This project where the error occurs, or any other project I try to run with Tauri while that accessibility app is running in the background causes the above error. All apps have a different package name. But only if there is one tauri app running will that app run.

@amrbashir I could try to make a repro, but there wouldn't really be anything to repro, as this happens with just running the exacts steps above for me, with the simple addition of already having an installed Tauri app running in the background.

jquesada2016 commented 2 years ago

I misread this comment. When I changed the package identifier (not the package name), then the app successfully launched.

Is it possible to add a warning note in the documentation that states that if two different Tauri apps are running, and have the same identifier, than the second app will not work?

As these were personal projects and were not expected to be published anywhere, I never considered the uniqueness requirement of the package identifier.

lucasfernog commented 2 years ago

@jquesada2016 can you give us more details on how you're running these apps? I tried again installing two MSI for different projects with the same bundle identifier and running both at the same time, but I still cannot reproduce the issue.

jquesada2016 commented 2 years ago

Sure!

First I generated the msi installer with npx tauri build for the first app. I installed this app and started it. After this, I create a new tauri project, you can generate it any way you'd like, they all result in the same error. Then, while the first installed app is still running, run npx tauri dev, which does open a window, tough blank and the above error message logged in the terminal.

If I quit out of the first app which is running in the background, and try npx tauri dev on the second app, then that second app works.

jquesada2016 commented 2 years ago

If you'd like, I can put the project for the first app as-is up on GitHub and link it here if it might help. That app isn't doing anything particularly fancy, however.

lucasfernog commented 2 years ago

I still can't reproduce it, but I assume this happens because both applications are using the same data directory. I'll add this to the documentation, though the CLI already shows a useful error if you use the default identifier.

kimlimjustin commented 2 years ago

I can reproduce this by having old-version of tauri installed and opened while running dev process of the newest version of tauri installed

jquesada2016 commented 2 years ago

Yes! the app I have running in the background was produced by an older version of Tauri.

DehaiWang commented 1 year ago

did have one solution ? i meet the same thing in windows 11

maxt41 commented 1 year ago

Same here, installs fine, but then won't run.

zmooky commented 11 months ago

Same here. Building the end result of the tauri-app created template results in having an exe file that does run on Windows.

Choose: pnpm + rust + react + typescript :

pnpm create tauri-app@latest
cd tauri-app/
pnpm install
pnpm tauri build
maxt41 commented 11 months ago

Turns out my issue was due to secrets not being registered at build time causing the app to instantly crash. Using procmon you can see the crash and error messages.

altunenes commented 2 months ago

I have the same problem. last night it worked without any problem but now it compiles everything but it's not opening the app.

maxt41 commented 2 months ago

@altunenes would recommend running "procmon" it will show you some helpful log messages.

altunenes commented 2 months ago

@altunenes would recommend running "procmon" it will show you some helpful log messages.

thanks! I'm trying this now!

altunenes commented 2 months ago

Error A public key has been found, but no private key. Make sure to setTAURI_SIGNING_PRIVATE_KEYenvironment variable.

:D

maxt41 commented 2 months ago

I think that way nearly word for word the error I had too lol

altunenes commented 2 months ago

I'm sending this msg to the future:

My problem was solved after I copied and pasted onnxruntime.dll into the system32 folder in Windows.

I've been dealing with this problem all day, so don't ask me how I came up with such a solution :D, I've tried everything you can imagine haha.

In short, if your app is dependent on something (like gst, ffmpeg, cuda, or onnx like me) and it's crashing silently, make sure that these kinds of Path operations are somehow working in your app.