rstudio/gt

gtsave() issue with Google Chrome v128

Closed this issue · 3 comments

Been a stressful day.

It seems an auto-update to google chrome to new version v128 has made gtsave( ) not work when saving to image files.

Sample Code:

library(gt)

Create a sample gt table

gt_table <- gt(mtcars[1:5, ])

Save the gt table to PNG using gtsave()

gtsave(gt_table, "table.png")

Error Output:

Error in with_random_port():
! Cannot find an available port. Please try again.
Caused by error in Sys.getenv():
! wrong type for argument
Run rlang::last_trace() to see where the error occurred.

Hi! Thanks for the report! Please try updating the chromote package to version 0.3.1 install.packages("chromote"). Let me know if it worked

Confirmed issue is with Chromote rstudio/chromote#170. FWIW, I set the env var in my .Renviron and don't encounter the issue

CHROMOTE_HEADLESS="new"

Thanks @olivroy. That was my blind spot - i was running Chromote 0.3.0.

Updating to 0.3.1 fixed it.
Thanks so much for the help!