cakebake / markdown-themeable-pdf

ARCHIVED. NOT MAINTAINED. Themeable Markdown Converter (Print to PDF, HTML, JPEG or PNG)
https://atom.io/packages/markdown-themeable-pdf
133 stars 37 forks source link

Uncaught TypeError: Path must be a string. Received undefined #37

Closed allenye0119 closed 3 years ago

allenye0119 commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.5.4 System: Mac OS X 10.11 Thrown From: markdown-themeable-pdf package, v0.10.2

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:8

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:477:5)
    at Object.module.exports.markdownThemeablePdf.getConfigFilePath (/Users/Allen/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:549:28)
    at /Users/Allen/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:346:44
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

  2x -1:09.8.0 advanced-open-file:move-cursor-down (atom-text-editor.path-input.editor.mini.is-focused)
     -1:00.9.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
     -0:55.2.0 pane:split-right (div.pdf-view)
     -0:41.3.0 advanced-open-file:toggle (div.pdf-view)
  6x -0:38.6.0 advanced-open-file:autocomplete (atom-text-editor.path-input.editor.mini.is-focused)
     -0:32.3.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
  3x -0:31.1.0 advanced-open-file:move-cursor-down (atom-text-editor.path-input.editor.mini.is-focused)
     -0:30.3.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
     -0:24.3.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  2x -0:11.7.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:11.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:11.3.0 markdown-preview-plus:toggle (atom-text-editor.editor)
     -0:06.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  3x -0:04.4.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:02.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:02.4.0 markdown-themeable-pdf:export (atom-text-editor.editor)

Config

{
  "core": {
    "closeEmptyWindows": false,
    "packagesWithKeymapsDisabled": [
      "git-control"
    ],
    "themes": [
      "nucleus-dark-ui",
      "one-dark-syntax"
    ]
  },
  "markdown-themeable-pdf": {
    "codeHighlightingTheme": "atelier-cave-dark.css",
    "enableCustomFooter": false,
    "enableCustomHeader": false
  }
}

Installed Packages

# User
advanced-open-file, v0.14.2
color-picker, v2.1.1
emmet, v2.4.1
file-icons, v1.6.17
jshint, v1.8.3
language-latex, v0.6.1
language-matlab, v0.2.0
latexer, v0.3.0
markdown-preview-plus, v2.2.2
markdown-themeable-pdf, v0.10.2
minimap, v4.19.0
minimap-cursorline, v0.1.0
nucleus-dark-ui, v0.7.10
pdf-view, v0.45.0
pigments, v0.24.2
react, v0.14.1
react-snippets, v0.3.0

# Dev
No dev packages
cakebake commented 8 years ago

I bet on a misconfiguration. Closing because of no steps to reproduce.

noraj commented 8 years ago

I got the same error : [Enter steps to reproduce below:]

  1. Into a markdown file
  2. Right-click on "Markdown to PDF"

Atom Version: 1.7.4 System: Unknown Windows Version Thrown From: markdown-themeable-pdf package, v1.0.1

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:8

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.win32.join (path.js:221:5)
    at Object.module.exports.markdownThemeablePdf.getConfigFilePath (C:\Users\Shark\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:551:28)
    at C:\Users\Shark\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:348:44
    at tryToString (fs.js:414:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)

Commands

     -2:04.6.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -2:02.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:53.1.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:50.7.0 core:paste (atom-text-editor.editor.is-focused)
  2x -1:48.1.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:42.9.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -1:40.8.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -1:34.4.0 core:move-down (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:33 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:24.8.0 core:paste (atom-text-editor.editor.is-focused)
     -1:22.8.0 core:save (atom-text-editor.editor.is-focused)
     -0:52 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)
     -0:36.1.0 markdown-preview:toggle (atom-text-editor.editor.is-focused)
     -0:25.7.0 core:save-as (div.markdown-preview.native-key-bindings)
     -0:16 pane:close (h1#projet-dir-exe.)
     -0:02.7.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "language-x86-64-assembly",
      "language-assembly",
      "pigments",
      "markdown-scroll-sync"
    ]
  }
}

Installed Packages

# User
language-x86, v1.0.1
markdown-themeable-pdf, v1.0.1

# Dev
No dev packages
blockmaster-anders commented 8 years ago

Resolved this by changing the md file name to not include () - perhaps it does not like other special chars that windows allows. I figured since the demo.md worked it was something with my file.

cshu0520 commented 5 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64 Electron: 2.0.18 OS: Unknown Windows version Thrown From: markdown-themeable-pdf package 1.2.1

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:28

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:501:7)
    at Object.getConfigFilePath (/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:575:28)
    at /packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:365:44
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Commands

     -3:58.3.0 markdown-themeable-pdf:export (div.line)
  2x -2:52.7.0 window:toggle-menu-bar (input.hidden-input)
  2x -2:16.7.0 tree-view:toggle (ul.list-inline.tab-bar.inset-panel)
     -2:06.5.0 symbols-view:toggle-project-symbols (input.hidden-input)
     -2:02.6.0 core:select-all (input.hidden-input)
     -1:29.6.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
  2x -0:25.1.0 find-and-replace:use-selection-as-replace-pattern (input.hidden-input)
     -0:18.6.0 markdown-preview-enhanced:toggle (div.line.cursor-line)
     -0:11.1.0 markdown-themeable-pdf:export (div.line)

Non-Core Packages

atom-image-resize 0.3.0 
document-outline 2.1.2 
intentions 1.1.5 
language-markdown 0.29.0 
markdown-image-assistant 0.2.2 
markdown-preview-enhanced 0.15.10 
markdown-themeable-pdf 1.2.1 

I got this issue on my Windows 10

My PDF conversion was working well for several weeks

But this issue happens after I reboot my PC, and now it cannot be fix by rebooting again

I've tried to delete all characters including "_" in my file path

I also tried to reopen atom several times, but none of the above solve this issue

Any ideas..? Should I change any setting of this package?

---------------Update

Okay now I think it's not the issue about this package

Because I found that the "Project Tab" in atom somehow disappeared

And it showed up again when I was trying to rename my .md files in atom

After the project tab showed up, the PDF conversion works again

It's sounds strange but at least everything is fine now xD

ChristopherHanson commented 5 years ago

I had the same problem as cshu0520 and I can confirm after I was able to open the project pane, aka "tree view" using "Packages > Tree View > Toggle" (⌘/) the error went away. (edited to escape the slash w/ the macOS shortcut)

sumover commented 5 years ago

I had the same problem too.And I fund that I was not open the folder at atom, I just open the *.md at atom.So open all folder at atom,you can fix this problem.(From a Caiji programmer,2333)

sumover commented 5 years ago

(中文版解决方案) 我是在linux下用命令行打开的一个Markdown文件,然后右键Markdown to PDF的时候出的问题. 似乎是如果只打开了一个文件就会出现这个问题....请尽量打开文件夹吧...

anitahwu commented 5 years ago

I had the same problem on Windows 10 when I opened a .md file directly (from desktop or another folder). Opening the Tree View fixed it only if I added a Project folder. It didn't have to be the directory where the file was being held either, just any Project folder or it wouldn't work.

sumover commented 5 years ago

so,open it in folder(possiblity).

---Original--- From: "Anita Wu"notifications@github.com Date: Tue, Apr 30, 2019 02:54 AM To: "cakebake/markdown-themeable-pdf"markdown-themeable-pdf@noreply.github.com; Cc: "sumover"2638864855@qq.com;"Comment"comment@noreply.github.com; Subject: Re: [cakebake/markdown-themeable-pdf] Uncaught TypeError: Path must be a string. Received undefined (#37)

I had the same problem on Windows 10 when I opened a .md file directly (from desktop or another folder). Opening the Tree View fixed it only if I added a Project folder. It didn't have to be the directory where the file was being held either, just any Project folder or it wouldn't work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

cakebake commented 5 years ago

Is pending for re-examination

sumover commented 5 years ago

Is pending for re-examination

so....why pending for re-examination?just cd to folder and "atom ."

cakebake commented 3 years ago

Hello, sorry, but I will no longer maintain the project.

This project is archived because the owner no longer uses the Atom Editor.

It would be very good to find a new owner for this project, who will take care of updating and expanding the Atom package. A new version based on Chrome Headless has already been prepared in a feature branch.