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 'error' of undefined #1196

Closed
sunlubo opened this issue Sep 16, 2016 · 7 comments · Fixed by #1253
Closed

Cannot read property 'error' of undefined #1196

sunlubo opened this issue Sep 16, 2016 · 7 comments · Fixed by #1253
Assignees
Milestone

Comments

@sunlubo
Copy link

sunlubo commented Sep 16, 2016

I'm trying to beautify my markdown but I get the error saying "Cannot read property 'error' of undefined"

'atom' version: 1.10.2
'atom-beautify' version: 0.29.12

Error Info:
Cannot read property 'error' of undefined
TypeError: Cannot read property 'error' of undefined
at /Users/sun/.atom/packages/atom-beautify/src/beautifiers/remark.coffee:42:10
at Promise._execute (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:299:9)
at Promise._resolveFromExecutor (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:77:14)
at Remark.module.exports.Remark.beautify (/Users/sun/.atom/packages/atom-beautify/src/beautifiers/remark.coffee:36:16)
at /Users/sun/.atom/packages/atom-beautify/src/beautifiers/index.coffee:316:24
at Promise._execute (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:299:9)
at Promise._resolveFromExecutor (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:77:14)
at /Users/sun/.atom/packages/atom-beautify/src/beautifiers/index.coffee:238:18
at tryCatcher (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
at PromiseArray._resolve (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:125:19)
at PromiseArray._promiseFulfilled (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:143:14)
at Promise._settlePromise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:572:26)
at Promise._settlePromise0 (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
at ReductionPromiseArray._resolve (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/reduce.js:61:19)
at Promise.completed as _fulfillmentHandler0
at Promise._settlePromise (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:564:21)
at Promise._settlePromise0 (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:148:10)
at Async.drainQueues (/Users/sun/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)

@prettydiff prettydiff added the bug label Sep 16, 2016
@Terminl3nt
Copy link

yes I also found this bug, when I save my markdown file. I use the Atom Material Theme

@mikewesthad
Copy link

Ditto - this bug only happens for me when using Remark. Tidy Markdown still works (though I find Tidy's formatting to be hard to read).

I had to install the last version apm install atom-beautify@0.29.11 to get Remark working again.

@vmuriart
Copy link
Contributor

Same problem on both .12 and .13, reverting to 0.29.11 did the trick

@garystafford
Copy link

I concur, both 0.29.12 and 0.29.13 threw the following error with Markdown, using Remark. Reverting to 0.29.11 fixed the issue. Thank you @mikewesthad and @vmuriart!

Cannot read property 'error' of undefined
Hide Stack Trace
TypeError: Cannot read property 'error' of undefined
    at /Users/gstaffo/.atom/packages/atom-beautify/src/beautifiers/remark.coffee:42:10
    at Promise._execute (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:299:9)
    at Promise._resolveFromExecutor (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:77:14)
    at Remark.module.exports.Remark.beautify (/Users/gstaffo/.atom/packages/atom-beautify/src/beautifiers/remark.coffee:36:16)
    at /Users/gstaffo/.atom/packages/atom-beautify/src/beautifiers/index.coffee:316:24
    at Promise._execute (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/debuggability.js:299:9)
    at Promise._resolveFromExecutor (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:77:14)
    at /Users/gstaffo/.atom/packages/atom-beautify/src/beautifiers/index.coffee:238:18
    at tryCatcher (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at PromiseArray._resolve (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:125:19)
    at PromiseArray._promiseFulfilled (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise_array.js:143:14)
    at Promise._settlePromise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:572:26)
    at Promise._settlePromise0 (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
    at Promise._settlePromiseFromHandler (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:522:17)
    at Promise._settlePromise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Promise._fulfill (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:636:18)
    at Promise._resolveCallback (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:431:57)
    at ReductionPromiseArray._resolve (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/reduce.js:61:19)
    at Promise.completed [as _fulfillmentHandler0] (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/reduce.js:122:15)
    at Promise._settlePromise (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:564:21)
    at Promise._settlePromise0 (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:148:10)
    at Async.drainQueues (/Users/gstaffo/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)

@Glavin001
Copy link
Owner

Hmm this may be because of ba09880

If someone submits a Pull Request reverting to a version of Remark that they confirm works I will merge and publish. Thank you!

@Glavin001 Glavin001 self-assigned this Sep 27, 2016
@Glavin001 Glavin001 added this to the v0.30.0 milestone Sep 27, 2016
@lovesegfault
Copy link

Experiencing the same issue here using Atom 1.10.2 and atom-beautify 0.29.13

vmuriart added a commit to vmuriart/atom-beautify that referenced this issue Oct 8, 2016
Remark v4.2.2 is the latest compatible version. It breaks on Remark v5.0.0
This was referenced Oct 8, 2016
@Glavin001
Copy link
Owner

Published to v0.29.15

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

Successfully merging a pull request may close this issue.

8 participants