Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in onRejected(reason) : code: -32000 message: Browser window not found #77

Open
privefl opened this issue Aug 27, 2024 · 10 comments

Comments

@privefl
Copy link

privefl commented Aug 27, 2024

renderthis::to_pdf() used to work fine, now I get this error a few months ago, I don't know why.

@privefl
Copy link
Author

privefl commented Aug 27, 2024

When I use partial_slides = FALSE, I get another error:

Error in force(expr) : 
  Failed to generate output. Reason: Failed to open http://127.0.0.1:4921/favicon.ico (HTTP status code: 404)

@jhelvy
Copy link
Owner

jhelvy commented Aug 27, 2024

I also am getting this, it recently emerged. I don't think we changed anything to the package, so my guess is something changed in a dependency.

@privefl
Copy link
Author

privefl commented Aug 28, 2024

For the first error, I tried to change my default web browser to either Edge/Chrome/Firefox,
But that didn't help.

@robert-cope
Copy link

I've also encountered this favico.ico error this week (late August 2024), on documents that converted successfully last week, and I haven't been able to work out what changed. I can make the renderthis::to_pdf() conversion work if I add the following html to the header:
<link rel="shortcut icon" href="#" />
(which I believe means it won't look for a favicon.ico)

In practice I do this in the yaml of a Qmd source like:

format: 
  revealjs:
    include-in-header:
      - text: <link rel="shortcut icon" href="#" />

@privefl
Copy link
Author

privefl commented Aug 29, 2024

I tried to put this <link /> in an HTML file and use

output:
  xaringan::moon_reader:
    includes:
      in_header: "no_favicon.html"

But it does not change anything; am I doing anything wrong here?

@robert-cope
Copy link

Doing exactly that fixes the favicon error for me (when testing on the default xaringan template).

@privefl
Copy link
Author

privefl commented Aug 29, 2024

Okay, if I put this in no_favicon.html

<html>
<link rel="shortcut icon" href="#" />
</html>

or simply

<link rel="shortcut icon" href="#" />

it now works with partial_slides = FALSE.
(I don't know why it didn't work the first time)


If then trying again with partial_slides = TRUE, I get the same initial error, or sometimes a new error:

Error: Chromote: timed out waiting for response to command Target.createTarget

@jhelvy
Copy link
Owner

jhelvy commented Aug 29, 2024

Sorry everyone, I'm traveling this week so haven't had a chance to dig in and find the issue, but I suspect it has something to do with Chrome looking for a favicon, hopefully we can find a simple fix in the package itself so you don't have to insert that placeholder code. @gadenbuie if you have time can you take a look? I feel like we should be able to just inject that code to avoid the favicon somewhere, or the root issue might be something outside of renderthis.

@gadenbuie
Copy link
Collaborator

gadenbuie commented Aug 29, 2024

This little (quite big) bug is related to recent changes in Chrome to headless mode. Unfortunately, renderthis depends on both pagedown (complex_slides = FALSE) and chromote (complex_slides = TRUE), so we'll need fixes to happen in both of those packages first.

@jhelvy
Copy link
Owner

jhelvy commented Aug 29, 2024

That's what I was afraid of :(
Looks like for now people will have to do the hack suggested above before a fix is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants