cjoh / status-stats

A derivative of @segphault's status-wordcount. Displays wordcount, grade level, and Flesh-Kincaid scores, to help you write for your audience.
MIT License
1 stars 3 forks source link

Uncaught TypeError: undefined is not a function #2

Open clintecker opened 9 years ago

clintecker commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.179.0 System: Mac OS X 10.10.2 Thrown From: status-stats package, v0.1.0

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/clint/.atom/packages/status-stats/lib/status-stats-view.coffee:13

TypeError: undefined is not a function
  at StatusStatsView.module.exports.StatusStatsView.updateWordCount (/Users/clint/.atom/packages/status-stats/lib/status-stats-view.coffee:13:20)
  at atom-workspace.<anonymous> (/Users/clint/.atom/packages/status-stats/lib/status-stats-view.coffee:1:1)
  at atom-workspace.handler (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:110:34)
  at atom-workspace.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at atom-workspace.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:156:19)
  at PaneContainerView.jQuery.fn.trigger (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:64:23)
  at PaneContainerView.module.exports.PaneContainerView.onActivePaneItemChanged (/Applications/Atom.app/Contents/Resources/app/src/pane-container-view.js:53:19)
  at /Applications/Atom.app/Contents/Resources/app/src/pane-container-view.js:3:61
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app/src/pane-container.js:347:34
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:264:22)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:328:21)
  at Pane.module.exports.Pane.activateItemAtIndex (/Applications/Atom.app/Contents/Resources/app/src/pane.js:322:19)
  at Pane.module.exports.Pane.activatePreviousItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:293:21)
  at atom-pane.atom.commands.add.pane:show-previous-item (/Applications/Atom.app/Contents/Resources/app/src/pane-element.js:185:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:172:20)

Commands

     -1:35.0 core:backspace (atom-text-editor.editor)
     -1:34.9 core:save (atom-text-editor.editor)
     -1:34.2 core:backspace (atom-text-editor.editor)
  2x -1:33.9 core:save (atom-text-editor.editor)
     -0:38.4 project-find:show (atom-text-editor.editor)
     -0:36.5 core:confirm (atom-text-editor.editor.mini)
     -0:34.9 project-find:show (atom-text-editor.editor.mini)
     -0:34.6 core:confirm (atom-text-editor.editor.mini)
     -0:27.1 project-find:show (atom-text-editor.editor)
     -0:25.8 core:confirm (atom-text-editor.editor.mini)
     -0:18.4 core:backspace (atom-text-editor.editor)
     -0:15.7 core:save (atom-text-editor.editor)
     -0:14.8 pane:show-previous-item (atom-text-editor.editor)
     -0:05.7 core:backspace (atom-text-editor.editor)
     -0:03.6 core:save (atom-text-editor.editor)
     -0:02.3 pane:show-previous-item (atom-text-editor.editor)

Config

{
  "core": {
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store",
      ".pyc"
    ],
    "disabledPackages": [
      "linter-pylint",
      "python-isort",
      "travis-ci-status",
      "indent-guide-improved"
    ],
    "themes": [
      "atom-dark-ui",
      "seti-syntax"
    ]
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.2.3
atom-beautify, v0.21.3
atom-python-debugger, v0.2.1
git-log, v0.2.0
git-plus, v4.4.2
linter, v0.11.1
linter-python-pep8, v0.2.0
linter-python-pyflakes, v0.1.0
merge-conflicts, v1.2.10
minimap, v4.1.4
minimap-git-diff, v3.1.1
script, v2.16.0
seti-syntax, v0.3.1
status-stats, v0.1.0
virtualenv, v0.6.2

# Dev
No dev packages
jbrains commented 9 years ago

To reproduce, start with one buffer with unsaved content.

  1. Turn on status-stats.
  2. Close the dirty buffer. You'll see the "do you want to save?" dialog.
  3. Do not save the file. Now you should see the notification of an uncaught TypeError.

untitled_-_atom_and_uncaught_typeerror__undefined_is_not_a_function_ _issue__2_ _cjoh_status-stats

After dismissing the caught TypeError dialog, I can successfully close the dirty buffer. (I have to choose again not save it to a file.) After this, if I try to create a new buffer, I see no editor pane and therefore can't see any of the text I type. I can open several new buffers and I see no editor pane. See screenshot:

untitled_-_atom

After I close the window (and not just all the tabs without editor panes), I can create a new buffer that behaves as expected: the editor pane appears and I can type into it.

untitled_-_atom_and_uncaught_typeerror__undefined_is_not_a_function_ _issue__2_ _cjoh_status-stats

From here, I can reproduce the entire chain of events.

jbrains commented 9 years ago

This also happens if the current active pane is not a text editor, but instead (for example) a Markdown preview window.