Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'pre' of undefined #240

Open
1 of 2 tasks
gphillips-ema opened this issue May 11, 2021 · 0 comments
Open
1 of 2 tasks

Cannot read property 'pre' of undefined #240

gphillips-ema opened this issue May 11, 2021 · 0 comments

Comments

@gphillips-ema
Copy link

gphillips-ema commented May 11, 2021

Prerequisites

Issue description

When trying to convert a markdown file to pdf I get the following error in the console.

TypeError: Cannot read property 'pre' of undefined
    at showdownHighlight (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/showdown-highlight/lib/index.js:32)
    at _parseExtension (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/showdown/dist/showdown.js:2301)
    at Array.forEach (<anonymous>)
    at Object.showdown.helper.forEach (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/showdown/dist/showdown.js:653)
    at _constructor (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/showdown/dist/showdown.js:2266)
    at new showdown.Converter (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/showdown/dist/showdown.js:2238)
    at parseMarkdownToHtml (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/mdpdf/src/index.js:69)
    at /Users/gphillips/.atom/packages/markdown-pdf/node_modules/mdpdf/src/index.js:115
    at tryCatcher (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/util.js:16)
    at Promise._settlePromiseFromHandler (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/promise.js:547)
    at Promise._settlePromise (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/promise.js:604)
    at Promise._settlePromise0 (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/promise.js:649)
    at Promise._settlePromises (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/promise.js:729)
    at Promise._fulfill (/Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/promise.js:673)
    at /Users/gphillips/.atom/packages/markdown-pdf/node_modules/bluebird/js/release/nodeback.js:42
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61)

This is followed by another error.

TypeError: Cannot read property 'name' of undefined
    at Object.<anonymous> (fallback.js? [sm]:20)
    at Generator.next (<anonymous>)
    at step (fallback.js? [sm]:28)
    at fallback.js? [sm]:28
    at new Promise (<anonymous>)
    at Object.convert (fallback.js? [sm]:28)
    at Object.<anonymous> (convert.js? [sm]:57)
    at Generator.throw (<anonymous>)
    at step (/Users/gphillips/.atom/packages/markdown-pdf/lib/actions/convert.js:7)

Steps to reproduce

Create a .md file and enter any text.

Trigger conversion to pdf.

Expected behavior: [What you expect to happen]

Generate a pdf document of the markdown file.

Actual behavior: [What actually happens]

Raises an error with prompt to check console.

Input

Any text.

Versions

Atom : 1.57.0
Electron: 9.4.4
Chrome : 83.0.4103.122
Node : 12.14.1

apm 2.6.2
npm 6.14.13
node 12.14.1 x64
atom 1.57.0
python 3.7.6
git 2.30.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant