yzane / vscode-markdown-pdf

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

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

Open titanseason opened 4 years ago

titanseason commented 4 years ago

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
yzane commented 4 years ago

Please upgrade Markdown PDF to ver1.4.3 and try.

alanwunsche commented 4 years ago

Also seeing this error in VScode ver1.4.4

tatleung commented 2 years ago

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'

casualcontender commented 2 years ago

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.

FrederikPabst commented 1 year ago

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
fukusuket commented 10 months ago

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