allefeld/atom-pandoc-pdf

Uncaught TypeError: _electron2.default.shell.openItem is not a function

mauriziopassariello opened this issue · 2 comments

Hi, I don't seem able to have a preview PDF as I could before. I don't know what happened...

Atom: 1.56.0 x64
Electron: 9.4.4
OS: macOS 11.3
Thrown From: pandoc-pdf package 0.1.2

Stack Trace

Uncaught TypeError: _electron2.default.shell.openItem is not a function

At /Users/maurizio/.atom/packages/pandoc-pdf/lib/pandoc-pdf-processor.js:117

TypeError: _electron2.default.shell.openItem is not a function
    at PandocPdfProcessor.showFiles (/packages/pandoc-pdf/lib/pandoc-pdf-processor.js:117:20)
    at /packages/pandoc-pdf/lib/pandoc-pdf-view.js:167:38)

Commands

  2x -6:32.7.0 markdown-preview-plus:toggle (ul.list-inline.tab-bar.inset-panel)
  2x -6:06.9.0 pandoc-pdf:process (input.hidden-input)
     -4:36.4.0 markdown-preview-plus:toggle (input.hidden-input)
  2x -4:21.6.0 pandoc-pdf:process (input.hidden-input)

Non-Core Packages

autocomplete-bibtex 1.2.10 
file-type-icons 1.3.4 
language-markdown 0.37.0 
latex-completions 0.3.6 
markdown-image-assistant 0.2.2 
markdown-preview-plus 4.9.3 
markdown-table-editor 1.1.3 
pandoc-pdf 0.1.2 
pdf-view 0.72.0 
wordcount 3.2.0 
x-terminal 13.0.3 
zotero-citations 5.2.0 

Hm, I have no idea what this might be. I have the same Electron version installed, and it still works for me.

Could you try the following:

  • Edit the file /Users/maurizio/.atom/packages/pandoc-pdf/lib/pandoc-pdf-processor.js.
  • Change the line with the error (117) to shell.openItem(this.tempDir), i.e. remove electron..
  • Add the line import { shell } from 'electron' to the other imports at the top of the file.

The restart Atom and try again.

The error now happened for me, too, and I think I was able to fix it in the new version 0.1.3.