tauri
tauri copied to clipboard
[bug] The system cannot find the file specified on `tauri dev`
Describe the bug
Running npm run tauri dev
yields:
> tauri
Running BeforeDevCommand (`npm run dev`)
> [email protected] dev
> vite
VITE v3.0.2 ready in 561 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Info Watching C:\Users\shauh\Documents\chat\src-tauri for changes...
Compiling app v0.1.0 (C:\Users\shauh\Documents\chat\src-tauri)
Finished dev [unoptimized + debuginfo] target(s) in 4.16s
thread 'main' panicked at 'error while running tauri application: Runtime(CreateWebview(WebView2Error(WindowsError(Error { code: 0x80070002, message: The system cannot find the file specified.
}))))', src\main.rs:9:10
Reproduction
- Run
npm create tauri-app
- Select the
vite
with React and TypeScript template -
cd
into app -
npm install
-
npm run tauri dev
Expected behavior
I expect the starter boilerplate to develop, as no other changes have been made.
Platform and versions
Environment
› OS: Windows 10.0.22000 X64
› Webview2: 103.0.1264.49
› MSVC:
- Visual Studio Build Tools 2019
› Node.js: 18.6.0
› npm: 8.13.2
› pnpm: Not installed!
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.62.1
› cargo: 1.62.1
› Rust toolchain: stable-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.0.4
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.4,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.1,
› wry [RUST]: 0.19.0,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:5173/
› framework: React
App directory structure
├─ dist
├─ node_modules
├─ public
├─ src
└─ src-tauri
Stack trace
thread 'main' panicked at 'error while running tauri application: Runtime(CreateWebview(WebView2Error(WindowsError(Error { code: 0x80070002, message: The system cannot find the file specified.
}))))', src\main.rs:9:10
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:584
1: core::panicking::panic_fmt
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\panicking.rs:142
2: core::result::unwrap_failed
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\result.rs:1785
3: enum$<core::result::Result<tuple$<>,enum$<tauri::error::Error> >, 0, 26, Err>::expect<tuple$<>,enum$<tauri::error::Error> >
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\core\src\result.rs:1035
4: app::main
at .\src\main.rs:7
5: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\core\src\ops\function.rs:248
Additional context
Oddly, I am on Windows 11 - not 10 like it appears from tauri info
.
I have tried with both Nodejs v16 and v18. Also, I have tried with both rustc
/cargo
v1.61 and v1.62. Same result.
Weird, that error typically means that WebView2 is not installed, which is not the case according to tauri info 🤔
And about the Windows version number: it's actually not that odd considering that windows 11 is windows 10 with some ui changes. And btw the value we display is what the OS itself reports back. The only difference here is the build number, 19xxx is windows 10 and 2xxxx is windows 11
Can you try re-running the WebView2 installer? Maybe manually executing it with elevated permissions?
The only difference here is the build number, 19xxx is windows 10 and 2xxxx is windows 11
Ah. Thank you for clearing that up.
Can you try re-running the WebView2 installer?
I should have mentioned - this was one of the first things I tried. Initially, the installer just failed with the error that WebView2 is already installed. After that, I tinkered with some settings to disable and re-enable it (I do not know if I actually managed to do anything here).
I would try updating the MSVC by installing Microsoft Visual Studio Build Tools 2022. Is the Windows SDK installed too? @ShaunSHamilton Probably something went wrong in the installation process.
I encountered the same problem, and install webview2, this is solved
Closing as stale, and I have not found time to further investigate/troubleshoot.
Hi, I got this issue popping up too. My tauri info says I have WebView2 and if I try to install WebView2, the installer says that it's already installed. My tauri info:
Environment
› OS: Windows 10.0.22000 X64
› Webview2: 111.0.1661.54
› MSVC:
- Visual Studio Community 2022
› Node.js: 19.4.0
› npm: 9.2.0
› pnpm: 7.29.0
› yarn: Not installed!
› rustup: 1.25.2
› rustc: 1.70.0-nightly
› cargo: 1.70.0-nightly
› Rust toolchain: nightly-x86_64-pc-windows-msvc
Packages
› @tauri-apps/cli [NPM]: 1.2.3
Thanks for any help :D