klorenz / atom-regex-railroad-diagrams

display regex as railroad diagram, if cursor moves to it
MIT License
250 stars 31 forks source link

Uncaught TypeError: Cannot read property 'find' of undefined #46

Closed petey closed 9 years ago

petey commented 9 years ago

[Enter steps to reproduce below:]

  1. Install atom 0.206.0
  2. Put cursor over a regular expression.

Atom Version: 0.206.0 System: Mac OS X 10.10.3 Thrown From: regex-railroad-diagram package, v0.7.4

Stack Trace

Uncaught TypeError: Cannot read property 'find' of undefined

At /Users/petey/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram-view.coffee:125

TypeError: Cannot read property 'find' of undefined
  at RegexRailroadDiagramView.module.exports.RegexRailroadDiagramView.showRailRoadDiagram (/Users/petey/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram-view.coffee:125:15)
  at RegexRailroadDiagramView.module.exports.RegexRailroadDiagramView.updateRailRoadDiagram (/Users/petey/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram-view.coffee:97:14)
  at RegexRailroadDiagramView.updateRailRoadDiagram (/Users/petey/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram-view.coffee:1:1)
  at /Users/petey/.atom/packages/regex-railroad-diagram/lib/regex-railroad-diagram-view.coffee:21:10
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.cursorMoved (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1563:27)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:56:31
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Marker.module.exports.Marker.notifyObservers (/Applications/Atom.app/Contents/Resources/app.asar/src/marker.js:270:27)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/marker.js:65:26
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Marker.module.exports.Marker.emitChangeEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:390:20)
  at Marker.module.exports.Marker.update (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:339:12)
  at Marker.module.exports.Marker.setHeadPosition (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:140:19)
  at Marker.module.exports.Marker.setHeadBufferPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/marker.js:175:32)
  at Marker.module.exports.Marker.setHeadScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/marker.js:185:19)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:121:31
  at Cursor.module.exports.Cursor.changePosition (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:683:7)
  at Cursor.module.exports.Cursor.setScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:119:19)
  at Cursor.module.exports.Cursor.moveLeft (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:311:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1396:23
  at TextEditor.module.exports.TextEditor.moveCursors (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1554:9)
  at TextEditor.module.exports.TextEditor.moveLeft (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1395:19)
  at TextEditor.atom.commands.add.stopEventPropagation.core:move-left (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:326:19)
  at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:288:32)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

     -0:03.3.0 docblockr:parse-enter (atom-text-editor.editor.is-focused)
     -0:03.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:01.2.0 core:move-left (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "metrics",
      "cucumber-step",
      "coffee-compile",
      "git-grep",
      "project-ring",
      "project-switcher",
      "react",
      "pretty-json",
      "todo-list",
      "mocha-test-runner",
      "mocha-ui",
      "package-js-generator"
    ],
    "projectHome": "~/git/"
  }
}

Installed Packages

# User
atom-yamljson, v0.2.3
cucumber, v0.5.0
docblockr, v0.7.2
ember-cli-helper, v0.7.2
file-icons, v1.5.7
git-projects, v1.14.1
git-tab-status, v1.9.2
javascript-snippets, v1.0.0
language-arduino, v0.2.1
language-chef, v0.4.0
linter, v0.12.6
linter-csslint, v0.0.13
linter-js-yaml, v1.0.1
linter-jshint, v0.1.6
linter-jsonlint, v0.1.4
markdown-scroll-sync, v0.4.0
project-colorize, v0.2.0
regex-railroad-diagram, v0.7.4
symbols-tree-view, v0.9.3

# Dev
No dev packages
UnconventionalMindset commented 9 years ago

I confirm, this issue it's happening also to me

thomasgodart commented 9 years ago

Me too, in Atom 0.207.0

twss commented 9 years ago

Me too, in Atom 0.208.0

kogai commented 9 years ago

Me too, in Atom 0.208.0

ypresto commented 9 years ago

This doesn't happen when atom launched with --include-deprecated-apis. Updating to latest api is required..!

F0x06 commented 9 years ago

Me too, Atom 0.210.0

Nicolab commented 9 years ago

Me too, Atom 0.209

hayes commented 9 years ago

also happening on atom 1.0

klorenz commented 9 years ago

Hi all, is this still an issue, after I fixed deprecation issues?

cthill commented 9 years ago

I just updated to 0.8.3. It is working now.

Nicolab commented 9 years ago

Works fine now, thanks @klorenz :)