travs / markdown-pdf

Convert markdown to pdf, png or jpeg on the fly in Atom
MIT License
263 stars 44 forks source link

Uncaught AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to s... #207

Closed satheeshwaran closed 4 years ago

satheeshwaran commented 5 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.34.0 x64 Electron: 2.0.16 OS: Mac OS X 10.14.2 Thrown From: markdown-pdf package 2.2.0

Stack Trace

Uncaught AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'

At assert.js:42

AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'
    at /packages/markdown-pdf/node_modules/mdpdf/node_modules/html-pdf/lib/pdf.js:38:3)
    at /packages/markdown-pdf/node_modules/mdpdf/node_modules/html-pdf/lib/index.js:10:14)
    at /packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:483:27
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Commands

     -0:04.8.0 markdown-themeable-pdf:export (div.line)

Non-Core Packages

atom-python-run 0.9.7 
atom-react-native-style 0.2.0 
Hydrogen 2.8.0 
markdown-pdf 2.2.0 
markdown-themeable-pdf 1.2.1 
mr-markdown-pdf 1.6.0 
python-tools 0.6.9 
react 0.18.0 
react-es7-snippets 0.3.13 
wkwkrnht commented 5 years ago

It is on my environment. Until last time, it had been working correctly. And, no further update on my system. One difference is this device had been done clean install Windows 10 1903. Could you fix my issue?

Console log below: AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath' at new PDF (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\mdpdf\node_modules\html-pdf\lib\pdf.js:38:3) at Object.createPdf [as create] (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\mdpdf\node_modules\html-pdf\lib\index.js:10:14) at Promise (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\mdpdf\index.js:177:7) at Promise._execute (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\debuggability.js:313:9) at Promise._resolveFromExecutor (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:488:18) at new Promise (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:79:10) at createPdf (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\mdpdf\index.js:176:9) at readFile.then.then.then.then.md (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\mdpdf\index.js:169:10) at tryCatcher (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:517:31) at Promise._settlePromise (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\promise.js:643:18) at C:\Users\xudho\.atom\packages\markdown-pdf\node_modules\bluebird\js\release\nodeback.js:42:21 at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Muhammad-Al-Halaby commented 4 years ago

I'm facing the same error while trying to save Markdown to PDF:

AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath' at new PDF (C:\Users\Mu\.atom\packages\markdown-pdf\node_modules\mdpdf\node_modules\html-pdf\lib\pdf.js:38:3) at Object.createPdf [as create] (C:\Users\Mu\.atom\packages\markdown-pdf\node_modules\mdpdf\node_modules\html-pdf\lib\index.js:10:14) at C:\Users\Mu\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:483:27 at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

travs commented 4 years ago

Hi there, this should now work with the latest updates to a new version of mdpdf which uses puppeteer instead of PhantomJS.