yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
987 stars 203 forks source link

[SOLUTION] to dreaded "error: Failed to launch chrome! Syntax error: Unterminated quoted string" for ARM64/Aarch64 devices #125

Open skybldev opened 5 years ago

skybldev commented 5 years ago

This is a solution for everyone experiencing the issue of Puppeteer not working on Xenial ARM64 on a Chromebook. Very specific situation, but the situation I am in.

THANK YOU to the people on this Issue thread on the Puppeteer repo!! OP ran an RPi which also had an ARM64 CPU.

I run VSCode March 2019 Update in a xiwi instance of Crouton on a Google Chromebook XE513C24 (codename KEVIN) which has an Aarch64 Processor (compatible with ARM64). Everytime I try to export a markdown file to PDF I get this error:

error: Failed to launch chrome! Syntax error: Unterminated quoted string

Here is the solution!

First install chromium-browser and chromium-codecs-ffmpeg: reference

sudo apt install chromium-browser chromium-codecs-ffmpeg

That installs the ARM64 build of Chromium, which is different from the bundled Chromium.

Then, go to VSCode's JSON preferences and add this entry: reference

"markdown-pdf.executablePath": "/usr/bin/chromium-browser"

That changes which Chromium Puppeteer runs, to our proper, newly installed build.

Simple! You will now be able to export PDF and HTML like you normally would. If there is anything wrong please correct me; this is the solution that works for me with this specific situation, but it may not work for you.

jose-Abel commented 5 years ago

This solved my issue, thanks!

paulinechi commented 2 years ago

"markdown-pdf.executablePath": "/usr/bin/chromium-browser"

Hi thank you for the solution, could you clarify which file is the JSON preferences file? Is it settings.json? And I had this issue when using prerender-spa-plugin and not markdown-pdf, any idea what I should change "markdown-pdf.executablePath" to? Thanks!