octaltree / playwright-rust

Playwright port to Rust
316 stars 36 forks source link

"No such file or directory" error when calling Playwright::initialize() #22

Closed randall-coding closed 2 years ago

randall-coding commented 2 years ago

I started with this issue of a black browser display, then in an attempt to fix it I set up my dev environment on my new PC (also running Ubuntu 21). Now I'm running into this issue:

thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })', src/bin/webview.rs:39:58

when I call initialize:

let playwright = Playwright::initialize().await.unwrap();

This is the same code that was previously able to launch the browser on my other PC (though it produced a black display, it was operable with javascript and didn't crash).

Does anyone have an idea of what might be happening here? I'm not specifying a file or directory, but the playwright-rust code apparently is. Though I can't see why it would it be a problem.

randall-coding commented 2 years ago

Still haven't fixed the issue on my new machine setup, but on my old machine I was able to use firefox (not chromium however) without a black screen by upgrading my rustc and playwright version.

octaltree commented 2 years ago

If ubuntu. Delete /tmp/build-playwright-rust and ~/.cache/ms-playwright/playwright-rust/driver, run playwright with let playwright = Playwright::initialize().await.unwrap();, and verify that there is a driver in cache.

randall-coding commented 2 years ago

Thanks, this looks like an issue I forgot to update. I believe I fixed it with clearing the cache as you mention.