Quarto Render fails to create pdf due to Chrome headless mode

Hi folks,

I am unable to render my Quarto document into a pdf. I went down the rabbit hole hinted at here: Chrome Headless mode  |  Chromium  |  Chrome for Developers.

Eventually I manage to render my pdf from the CLI by running QUARTO_CHROMIUM_HEADLESS_MODE=new quarto render and that works fine, but I am unable to render from inside the RStudio IDE.

This is the error message I get

processing file: parametrized-reports-2.qmd

output file: parametrized-reports-2.knit.md

ERROR: Couldn't find open server.
Chrome process error: Old Headless mode has been removed from the Chrome binary. Please use the new Headless mode (Monitorloser Modus in Chrome  |  Chromium  |  Chrome for Developers) or the chrome-headless-shell which is a standalone implementation of the old Headless mode (הורדת Chrome הישן ללא ממשק גרפי כגרסה ללא דפדפן GUI  |  Blog  |  Chrome for Developers).

Stack trace:
Chrome process error: Old Headless mode has been removed from the Chrome binary. Please use the new Headless mode (Monitorloser Modus in Chrome  |  Chromium  |  Chrome for Developers) or the chrome-headless-shell which is a standalone implementation of the old Headless mode (הורדת Chrome הישן ללא ממשק גרפי כגרסה ללא דפדפן GUI  |  Blog  |  Chrome for Developers).

at criClient (file:///Applications/quarto/bin/quarto.js:38718:15)
at eventLoopTick (ext:core/01_core.js:214:9)
at async file:///Applications/quarto/bin/quarto.js:38676:22
at async Semaphore.runExclusive (file:///Applications/quarto/bin/quarto.js:38350:29)
at async Object.createPngsFromHtml (file:///Applications/quarto/bin/quarto.js:38947:42)
at async makePng (file:///Applications/quarto/bin/quarto.js:82312:70)
at async makeDefault (file:///Applications/quarto/bin/quarto.js:82372:24)
at async Object.cell (file:///Applications/quarto/bin/quarto.js:82395:20)
at async Promise.all (index 0)
at async Object.document (file:///Applications/quarto/bin/quarto.js:39242:25)

Error occurred during cleanup: NotFound: ESRCH: No such process

If you know what I am missing, I'll be most grateful

In case someone runs into the same issue. I installed the latest Quarto from the Quarto website. That superseded the Quarto version that came bundled with the RStudio IDE and then things magically worked and I can render from inside the IDE.