cs150bf / ever-notedown

Atom Editor Plugin
MIT License
140 stars 13 forks source link

Uncaught TypeError: Cannot read property 'tokens' of undefined #1

Open tnshrp opened 9 years ago

tnshrp commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.198.0 System: Mac OS X 10.10.3 Thrown From: ever-notedown package, v0.1.0

Stack Trace

Uncaught TypeError: Cannot read property 'tokens' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:128

TypeError: Cannot read property 'tokens' of undefined
  at DisplayBuffer.module.exports.DisplayBuffer.pixelPositionForScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:924:56)
  at DisplayBuffer.module.exports.DisplayBuffer.pixelRectForScreenRange (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:684:22)
  at DisplayBuffer.module.exports.DisplayBuffer.scrollToScreenRange (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:623:20)
  at DisplayBuffer.module.exports.DisplayBuffer.scrollToScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:669:19)
  at TextEditor.module.exports.TextEditor.scrollToScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2520:33)
  at /Users/prashant/.atom/packages/ever-notedown/lib/ever-notedown.coffee:1623:29
  at /Users/prashant/.atom/packages/ever-notedown/lib/ever-notedown.coffee:1316:9
  at _fulfilled (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:794:54)
  at self.promiseDispatch.done (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:823:30)
  at Promise.promise.promiseDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:756:13)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:564:44
  at flush (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/q/q.js:110:17)
  at process._tickCallback (node.js:357:13)

Commands

  4x -2:11.6.0 core:close (div.ever-notedown-preview.native-key-bindings)
     -1:36.7.0 ever-notedown:edit-note-template-custom2 (atom-pane.pane.active)
     -1:33.7.0 core:close (atom-text-editor.editor.is-focused)
  2x -1:24.3.0 ever-notedown:toggle-note-list (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
     -1:06.9.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:42.9.0 ever-notedown:toggle-note-list (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
     -0:36.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:30.4.0 ever-notedown:toggle (atom-pane.pane.active)

Config

{
  "core": {},
  "ever-notedown": {
    "pulledContentInSplitPane": true,
    "smartyPants": true
  }
}

Installed Packages

# User
atom-html-preview, v0.1.6
ever-notedown, v0.1.0

# Dev
No dev packages
cs150bf commented 9 years ago

I hope v0.1.1 fixes this...

cs150bf commented 9 years ago

I hope this issue is resolved for now...

tnshrp commented 9 years ago

Thanks for looking into this. Faced the same issue with the new version

cs150bf commented 9 years ago

@swiftkoala Would you mind posting the stack trace again (with the new version)? I'm a bit surprised because I thought I have wrapped the offending part of code inside a try...catch, so I have no clue about the "Uncaught TypeError".

In particular, your first stack trace points to ever-notedown.coffee:1623:29 which is now at ever-notedown.coffee:1642, and any error popping up there should get caught...