Closed chiaraherzog closed 1 month ago
Hi all, I have gotten the exact same issue. My code was still running three days ago, but now I get the same error. I have tested it with a very simple html file (see below). That works, but the html file, which worked three days ago is not knitting anymore. I tried to change a couple of things in that html file, but so far did not have any luck.
Thanks in advance!
Example html file that works:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Page</title>
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgAB/etM5aQAAAAASUVORK5CYII=" type="image/png">
</head>
Same issue here.. and after also trying renderthis::to_pdf()
(I needed to export slides) it looks like it could be an issue with chrome? Possibly related to https://github.com/rstudio/chromote/issues/170
Hi all, this is definitely an issue related to the most recent Chrome update. I rolled back to the previous version of Chrome and chrome_print()
is working again for me.
Hopefully the issue is resolved with the next Chrome update.
@jruddy12 how did you roll back to a previous version of Chrome? Do have a trusted site to download a slightly older version?
@CarlottaHS the following was recommended and worked for me:
https://www.slimjet.com/chrome/google-chrome-old-version.php
The only issue is that Chrome wants to auto-update every time you open the browser. I was using Chrome as my primary browser but I've been using Safari the past couple of days to prevent Chrome updating. I rely on chrome_print()
pretty heavily for automated reporting at work, so hoping there's a fix for it, but this is a good temporary work around.
@jruddy12 one idea to have a fixed version to use. Install a portable chromium in the version you need, and then configure chrome_print
to use this chrome version for any work it does.
Also you can try what has been discussed in chromote repo
There seems to be some changes in chrome that we need to take into account (while trying to see how we be backward compatible). I'll follow chromote work to match their fix.
About new headless mode : https://developer.chrome.com/docs/chromium/new-headless
same issue here after updating chrome
Chromium is a snap on Ubuntu. Some commands to get you back to a working version:
https://snapcraft.io/docs/quickstart-tour#pause-or-stop-automatic-updates https://snapcraft.io/docs/quickstart-tour#revert-to-an-earlier-revision
Looking forward to a solution to this problem with the new Chrome version. Taking the HTML file and printing/saving to a PDF file each time is tedious, to say the least!
For reference, as explained in other thread https://github.com/rstudio/chromote/issues/170#issuecomment-2310427013
This has been reported in the Chromium bug tracker in at least two places, we'll have to wait for an upstream fix.
We are waiting for news on those one. This seems to be a chrome bug, so we need to wait for now;
Especially tracking this one
@cderv I'm certain that the 404 for the favicon is related to the API changes from Chrome switching to --headless=new
by default, but it's not just Windows related (it repros for me on MacOS). My guess is that Chrome is going to have significant fallout over the next few weeks as everyone discovers subtle API changes between the two headless modes.
My guess is that Chrome is going to have significant fallout over the next few weeks as everyone discovers subtle API changes between the two headless modes.
yes I agree. I think we already had some in Quarto too. Though it seems rather limited right now. I'll be watching and let's keep in touch on this topic.
@cderv I think the quickest stop-gap method is to make --headless
configurable with a default of old
https://github.com/rstudio/pagedown/blob/6763538deb2cd78de05631715ea57085a85b8bd6/R/chrome.R#L94
This is what I'm proposing in chromote.
I had the same problem, asked about it on stackoverflow, and someone suggested placing a dummy flavicon.ico in the directory of the html you want chrome_printed. That workaround works for me. Is it a solution to prevent chrome_print looking for this file? Or else have a dummy flavicon.ico in the chrome_print?
@MMJansen That's a clever hack. I just implemented it in the servr package (which is used by pagedown::chrome_print()
). Please try:
remotes::install_github('yihui/servr')
Remember to restart R after installation. Thanks!
Once you confirm that the fix works (I've verified it myself but it'll be nicer if someone can verify it independently), I'll release a new version of servr to CRAN.
@yihui , the fix works! I did get an error from yihui-servr-e8a26b8/inst/examples/make2/example.Rmd
, that it could not create the example.Rmd
on a specific location, but servr_0.30.2 is installed. And pagedown::chrome_print
works again without having the manual added ico file in the folder. THANKS!
Okay, I just submitted it to CRAN, and hopefully the new release will appear soon.
Thanks @yihui!
New chrome update could have other problem, like in chromote. So we may need to change the way we call it in pagedown at some point.
I'll watch out!
Sounds good.
The new version of servr is on CRAN now, which means we can install.packages('servr')
.
Thank you for the servr
update!
That resolved the issue for me except one thing: now the PDF title (not the filename but the name that shows up in the tab when you open in a pdf reader like Foxit) is not the name of the file like it used to be, but the [name of the port (I think)]/[name of input html file]
.
The previous behavior was much better.
Thank you for the
servr
update! That resolved the issue for me except one thing: now the PDF title (not the filename but the name that shows up in the tab when you open in a pdf reader like Foxit) is not the name of the file like it used to be, but the[name of the port (I think)]/[name of input html file]
. The previous behavior was much better.
I do not have that issue. The title (as in the yaml title) is shown in the tab from acrobat reader, just as before.
ok thanks for letting me know! It must be a setting that was changed on my pdf reader.
I used the solution mentioned in #https://stackoverflow.com/a/43042288/27181508 , adding the snippet below solved for me.
<link rel="shortcut icon" href="#">
Thank you @yihui for servr
update, it works perfectly!
I use rmarkdown
in some of my packages so I just included the new dependency for version 0.31 to ensure new installations don't have the problem.
Following @silvana-takara example did not work for me if included directly into the Rmd file to be rendered, but could be perfectly achieved with a little javascript like so:
<script>
function add_favicon_link() {
const link = document.createElement("link");
link.rel = "shortcut icon";
link.href = "#";
document.head.appendChild(link);
}
add_favicon_link();
</script>
Hi all, thanks for this package! I've been using it to render my CV, but since last week it seems chrome_print has a new error: I tried multiple things and still get the error even when using a basic template (test.rmd, i.e. just the basic template saved) without any edits, leaving me to believe it is an issue with some new edits.
I have tried a manual fix by adding a link to an icon to the header of the HTML which displays as a favicon in the browser. When doing this I run into other issues with code recursivity.
Could you look into this for me? Otherwise I can't use this package to generate my CV anymore :(
My session info: