HTML failing to render on Windows 10
See original GitHub issuePrelude
I’m quite new to Rust so it’s very likely I’ve missed something simple! If that’s the case I’ll apologise now in advance! Any suggestions on how I can provide more information, or further diagnose the issue please do let me know.
System Information: Windows 10 Pro 10.0.18362
The Issue
The issue I’m having is that my example-project
application won’t render any HTML (it just shows an empty application window) when I execute: cargo run
. Interestingly enough though it works perfectly if I run the example_project.exe
in the /target/debug
directory.
As a side note, if I try to interact with the application window created by cargo run
(for example by minimising it) I will get the following fault in my console:
error: process didn't exit successfully: `target\debug\example_project.exe` (exit code: 0xc000041d)
This is probably just a red-herring due to the application being in some unintended state, but for the sake of completeness the application error I get in the Event Viewer is as follows:
Faulting application name: wwahost.exe, version: 10.0.18362.1, time stamp: 0xd44a1ada
Faulting module name: wwahost.exe, version: 10.0.18362.1, time stamp: 0xd44a1ada
Exception code: 0xc0000409
Fault offset: 0x0000000000089f9d
Faulting process id: 0x7034
Faulting application start time: 0x01d5a3c28cde3547
Faulting application path: C:\Windows\System32\wwahost.exe
Faulting module path: C:\Windows\System32\wwahost.exe
Report Id: 7c263c14-97b5-483c-9848-4591a0fa6f63
Faulting package full name: Microsoft.Win32WebViewHost_10.0.18362.449_neutral_neutral_cw5n1h2txyewy
Faulting package-relative application ID: DPI.Unaware
Full Context
Using a slightly modified elm-counter.rs
file as an example I have the following main.rs
file:
use web_view::*;
fn main() {
let file_content = include_str!("index.html");
println!("Hello World \n\n {}", file_content);
web_view::builder()
.title("Example Project")
.content(Content::Html(file_content))
.size(320, 480)
.resizable(false)
.debug(true)
.user_data(())
.invoke_handler(|_webview, _arg| Ok(()))
.run()
.unwrap();
}
And an index.html
file in the same (src) directory:
<html><body><h1>Test</h1></body></html>
The only dependency I have defined in my Cargo.toml
file is web-view
, but I don’t think anything else is required:
[dependencies]
web-view = { version = "0.5.4", features = ["edge"] }
Thank you for your time!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top GitHub Comments
Are you running as Administrator? Edge webview does not work when run as Administrator.
https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/issues/50
Gotcha. Cheers for clariying!
If there’s no objections I’ll fork this repo and update the documentation to be a bit more comprehensive for newcomers such as myself. I’ll see if I can raise a PR sometime this week.