vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

Error: ENOENT: no such file or directory, open 'd:\xx\Ljava\lang\String;'

Open titanseason opened this issue 5 years ago • 6 comments

When I right click the .md file content, and select Markdown PDF: Export(pdf) or other menu items, I got these errors:

Error: ENOENT: no such file or directory, open 'd\xx\Ljava\lang\String;'

and

ERROR: convertMarkdownToHtml()

And the exported pdf or html is empty.

Extra Infos:

  1. The version of Markdown PDF: 1.4.2 (2020/02/16)
  2. The version of my OS: Windows 7 (Pro)
  3. The version of VSCode: 1.42.1

titanseason avatar Mar 01 '20 11:03 titanseason

Please upgrade Markdown PDF to ver1.4.3 and try.

yzane avatar Mar 11 '20 18:03 yzane

Also seeing this error in VScode ver1.4.4

alanwunsche avatar Aug 05 '20 21:08 alanwunsche

I am also seeing the same issue on MacOS with M1 processor. The error message is:

Error: ENOENT: no such file or directory, open '.pdf/Users/...../lib/README_tmp.html'

tatleung avatar Dec 25 '21 05:12 tatleung

I received the same error that there was no such file or directory ...tmp.html.

The cause was that I had saved the file, but it wasn't saved as markdown. There was no extension. I found the solution when I tried to use pandoc to convert the same file and it gave the error that it could not deduce format from file extension. Once I added .md to the filename, it converted with no errors.

casualcontender avatar Jan 31 '22 18:01 casualcontender

Got the same error today:

Error: ENOENT: no such file or directory, open 'DIRECTORY_WERE_MY_MARKDOWN_FILE_IS\https:\www.usb.org\compliance'

in combination with

convertMarkdownToHtml()

For me it was quite obvious to solve so here is the casue. I had a header line as follows:

## 1.1. USB-IF:[Compliance](https://www.usb.org/compliance)

which leads to the error. When changing to (space after the colon!):

## 1.1. USB-IF: [Compliance](https://www.usb.org/compliance)

PDF export works flawless. Maybe this brings some insights.

Extra Infos:

The version of Markdown PDF: 1.5.0
The version of my OS: Windows 11 (Pro)
The version of VSCode: 1.80.1

FrederikPabst avatar Oct 04 '23 09:10 FrederikPabst

If the regular expression below matches, it is treated as an include, so it seems that the cause is an attempt to reference a local file. https://github.com/yzane/vscode-markdown-pdf/blob/5b6dbb25bec64071756cc8c02f5ce147ed85ade7/extension.js#L282-L287

I tried to fix it in the PR #351

fukusuket avatar Jan 14 '24 13:01 fukusuket