Headless_chrome error
AlessandroMattiazzi opened this issue · 5 comments
Hi,
I am creating many documents based on mdbook-pdf,
I'm experiencing not systematic errors from mdbook-pdf while genereting them, the error code:
thread '<unnamed>' panicked at 'Got a weird message: Close(Some(CloseFrame { code: Normal, reason: "" }))', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-pdf-headless_chrome-0.1.10\src\browser\transport\web_socket_connection.rs:117:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-12-12T08:23:15Z ERROR headless_chrome::browser::transport] Transport loop got disconnected from WS's sender (Chrome #Some(7716))
What browser are you using on your Windows system? Edge? Chrome? Is that browser now the latest version?
I only see one related issue (you opened that #441) in the headless_chrome upstream, so that should not be a very common one. I highly suspect that this is because the edge/chrome on your system is too old, please try to upgrade those versions.
You can also try to install again with the main branch cargo install --git https://github.com/HollowMan6/mdbook-pdf
to use the latest mdbook-pdf-headless_chrome (v0.1.11).
You can also specify your browser-binary-path
https://github.com/HollowMan6/mdbook-pdf/blob/main/test_doc/book.toml#L16 in the book.toml to make sure that headless_chrome finds the correct one.
If all of these suggestions didn't help you at all, then sorry I will have no further clue, and we have to wait for rust-headless-chrome/rust-headless-chrome#441
Ok, I can actually reproduce this from my side, so I guess, rather, headless_chrome hasn't fit the latest chrome/edge. But this is still a minor one as PDF generation is still OK.
Let's reopen this one and I will keep track of any updates from upstream.
This should be fixed by rust-headless-chrome/rust-headless-chrome#442
I have updated my fork with that PR as mdbook-pdf-headless_chrome (v0.1.12), so now everything should be fine. You just need to run cargo install --git https://github.com/HollowMan6/mdbook-pdf
and try again.
Sorry I didn't reply right away but I was busy with work, thanks for all the support, I'll try it as soon as possible