Open QCShen opened 3 years ago
This error looks a lot like this other: #185
Try following these steps: CTRL+shift+p > settings.json > add the line: "markdown-pdf.executablePath": "C:\chrome.exe" > restart vscode
Of course I've done this several times from the beginning. Error still occurred, but message changed if I set the path to chrome.exe. (I'm using Edge for default browser)
No idea what is the read target. (temp html or chrome.exe?)
OK. I'll try to debug. So, please let me know your environment.
And please try to make a pdf with the attached file. test.md
Thank you so much. @fwhv2042 Here is my environment. OS: Windows 10 Chrome: Always up to date (now 90) VSCode: Always up to date (now 1.56 user setup)
Trying make pdf from attached test.md also output the same error.
Thank you for your information. It ’s the same environment as me. Sorry to trouble you, but I want you to try one thing.
Please try changing the code as below. (Sorry, if it has already been done)
var options = {
executablePath: vscode.workspace.getConfiguration('markdown-pdf')['executablePath'] || puppeteer.executablePath(),
args: ['--lang='+vscode.env.language, '--no-sandbox', '--disable-setuid-sandbox'],
ignoreDefaultArgs: ['--disable-extensions'],
// Setting Up Chrome Linux Sandbox
// https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
};
The difference is as follows.
ignoreDefaultArgs: ['--disable-extensions'],
If the above method fails, try replacing it( C:\Users\ username
\.vscode\extensions\yzane.markdown-pdf-1.4.4 ) with this file and running export pdf.
extension.zip
I have included an error message, so please let me know the result.
Sorry for the late response. I added the ignoreDefaultArgs option but nothing changed. I also replaced the extension.js with the one you attached, after showing 'exportHtml OK', 'launch OK' and 'newPage OK', the same error message was displayed. 'page.pdf OK' message was not displayed.
Does this mean that the browser extensions I installed have nothing to do with this issue?
I disabled the "markdown-pdf.styles" option in VSCode setting, and comment out all the options except "path" , run on your test.md, the same error occurred. test_tmp.zip
Attached is the temporary html file.
Thank you for trying!! Probably a browser issue. I think that the markdownpdf extension is working fine. So, next step. Let me decide if it's a browser issue.
Please install Microsoft chromium edge
.
Microsoft chromium edge download
And please set "markdown-pdf.executablePath": C:\msedge.exe
My default browser is "Microsoft Edge based on Chromium". All the behavior I reported above was basically based on "Microsoft Edge based on Chromium", except my 2nd post on replying to your request to setting "markdown-pdf.executablePath" to chrome.
The error is produced by puppeteer, so I tried replacing the puppeteer(which is "puppeteer-core": "^2.1.1") used in markdownpdf 1.44 with the one(which is "puppeteer": "^1.3.0") used in markdownpdf 1.2.0, and everything goes well, PDF is successfully generated. This approach also worked fine to fix the error when using markdownpdf 1.2.1 who uses "puppeteer": "^1.20.0".
It seems that the error was produced by puppeteer newer the v1.3, and I traced the puppeteer source to try to find out the reason, but nothing comes out yet (likely the timeout setting things). @fwhv2042 san, thank you very much for your help. I guess here is the wrong place to discuss. Anyway any help is welcome.
Excuse me for interrupting. Should this be rolled back to markdown 1.2.1? I tried it, but I got Error: puppeteer.launch() again.
I got an error when exporting pdf.
This error only occurs on the version higher than v1.2.0. (on versions that prior to 1.2.1 everything is ok.)
Does anyone experience the same issue?