markushedvall / plantuml-viewer

PlantUML Viewer package for Atom
MIT License
61 stars 14 forks source link

TypeError: Cannot read property 'onDidStopChanging' of undefined #31

Open jneuendorf opened 7 years ago

jneuendorf commented 7 years ago

I posted the below error description earlier today in Atom's find-and-replace issue tracker (see this). The answer was to create an issue here first. So here it is:


[Enter steps to reproduce:]

  1. open plantUML viewer with PlantUML Viewer > Toggle Viewer
    • a split pane right show up
  2. edit and save the plantUML source file
  3. click/focus the plantUML preview

I tried debugging a little bit (until PaneContainer.module.exports.PaneContainer.setActivePane (/app.asar/src/pane-container.js:198:22)): It only appaers with the plantUML viewer being open but does not directly seem to be coming from the packages code. If you find out the opposite, let me know and I will move the issue the that package.

Atom: 1.14.1 x64 Electron: 1.3.13 OS: Mac OS X 10.11.6 Thrown From: find-and-replace package 0.206.1

Stack Trace

Uncaught TypeError: Cannot read property 'onDidStopChanging' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/find-and-replace/lib/buffer-search.js:46

TypeError: Cannot read property 'onDidStopChanging' of undefined
    at BufferSearch.setEditor (/app.asar/node_modules/find-and-replace/lib/buffer-search.js:46:48)
    at /app.asar/node_modules/find-and-replace/lib/find.js:49:36
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at /app.asar/src/pane-container.js:348:27
    at Pane.module.exports.Pane.observeActiveItem (/app.asar/src/pane.js:241:7)
    at /app.asar/src/pane-container.js:346:42
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at PaneContainer.module.exports.PaneContainer.setActivePane (/app.asar/src/pane-container.js:198:22)
    at Pane.module.exports.Pane.activate (/app.asar/src/pane.js:850:14)
    at /packages/plantuml-viewer/lib/plantuml-viewer-view.js:43:48)
    at /packages/plantuml-viewer/node_modules/jquery/dist/jquery.js:4435:9)
    at /packages/plantuml-viewer/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -1:27.9.0 core:save (input.hidden-input)
     -1:09.5.0 editor:newline (input.hidden-input)
     -1:08.8.0 core:save (input.hidden-input)
     -0:43.4.0 tree-view:duplicate (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:42.7.0 core:move-right (input.hidden-input)
  4x -0:42.6.0 core:move-left (input.hidden-input)
     -0:41.2.0 core:confirm (input.hidden-input)
     -0:37.9.0 core:copy (input.hidden-input)
     -0:37.3.0 core:paste (input.hidden-input)
     -0:35.3.0 core:save (input.hidden-input)
     -0:34.2.0 core:copy (input.hidden-input)
     -0:33.7.0 core:paste (input.hidden-input)
     -0:33.5.0 core:save (input.hidden-input)
  2x -0:22.6.0 core:close (input.hidden-input)
  2x -0:12.4.0 core:delete (input.hidden-input)
     -0:11.3.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 
atom-handlebars 1.3.0 
atom-material-syntax 1.0.2 
atom-material-ui 1.3.9 
autocomplete-paths 1.0.5 
code-annotations 2.1.3 
color-picker 2.2.5 
django-templates 0.5.0 
editorconfig 2.2.0 
emmet 2.4.3 
file-icons 2.0.15 
fold-functions 0.5.0 
highlight-line 0.12.0 
highlight-selected 0.12.0 
html-entities 0.4.0 
imdone-atom 2.1.18 
jquery-snippets 11.0.0 
language-applescript 0.3.0 
language-freemarker 0.2.0 
language-generic-config 1.3.0 
language-htaccess 0.1.1 
language-plantuml 0.2.0 
linter 1.11.22 
linter-coffeelint 1.2.1 
linter-csslint 1.3.3 
linter-erb 1.0.3 
linter-flake8 2.1.4 
linter-jshint 3.0.2 
linter-markdownlint 1.0.1 
MagicPython 1.0.6 
merge-conflicts 1.4.4 
minimap 4.26.8 
minimap-highlight-selected 4.5.0 
minimap-selection 4.4.0 
pdf-view 0.54.0 
php-cs-fixer 4.1.0 
pigments 0.39.0 
plantuml-viewer 0.7.1 
project-manager 3.3.3 
sort-lines 0.14.0 
Sublime-Style-Column-Selection 1.7.3 
tablr 1.8.1 
tabs-to-spaces 1.0.3 
Cphoenix commented 7 years ago

Adding my report FWIW.

Same steps as user above. Moving the panel between panes, focusing it, etc. causes this to show-up.

I've tried it with and without find-and-replace active (visible), and with find-and-replace empty or not, bug still rears its head.

Atom: 1.14.3 ia32 Electron: 1.3.13 OS: Microsoft Windows 10 Home Thrown From: find-and-replace package 0.206.3

Stack Trace

Uncaught TypeError: Cannot read property 'onDidStopChanging' of undefined

At C:\Users\RedactedUN\AppData\Local\atom\app-1.14.3\resources\app.asar\node_modules\find-and-replace\lib\buffer-search.js:46

TypeError: Cannot read property 'onDidStopChanging' of undefined
    at BufferSearch.setEditor (/app.asar/node_modules/find-and-replace/lib/buffer-search.js:46:48)
    at /app.asar/node_modules/find-and-replace/lib/find.js:49:36
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at /app.asar/src/pane-container.js:348:27
    at Pane.module.exports.Pane.observeActiveItem (/app.asar/src/pane.js:241:7)
    at /app.asar/src/pane-container.js:346:42
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at PaneContainer.module.exports.PaneContainer.setActivePane (/app.asar/src/pane-container.js:198:22)
    at Pane.module.exports.Pane.activate (/app.asar/src/pane.js:850:14)
    at Pane.module.exports.Pane.focus (/app.asar/src/pane.js:252:21)
    at /app.asar/src/pane-element.js:50:23)

Commands

     -2:05.6.0 core:delete (input.hidden-input)
  6x -2:05.4.0 core:move-right (input.hidden-input)
     -2:04.2.0 core:delete (input.hidden-input)
     -2:04.0 core:move-down (input.hidden-input)
     -2:03.6.0 core:move-up (input.hidden-input)
     -2:03.4.0 core:delete (input.hidden-input)
     -2:03.2.0 core:move-down (input.hidden-input)
     -2:02.4.0 core:backspace (input.hidden-input)
     -2:01.9.0 core:delete (input.hidden-input)
  6x -2:01.6.0 core:move-left (input.hidden-input)
     -2:00.5.0 core:backspace (input.hidden-input)
 19x -1:55.9.0 core:move-down (input.hidden-input)
  3x -1:54.7.0 core:move-up (input.hidden-input)
     -1:52.7.0 core:save (input.hidden-input)
     -0:22.8.0 find-and-replace:show (input.hidden-input)
     -0:16.1.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-vivid-syntax.theme-one-dark-ui.find-visible)

Non-Core Packages

advanced-open-file 0.16.5 
aligner 0.22.3 - disabled
aligner-python 1.0.1 - disabled
atom-alignment 0.12.1 
atom-beautify 0.29.17 
atom-commander 0.8.7 - disabled
atom-css-comb 3.1.0 - disabled
atom-ctags 5.0.0 
atom-dark-fusion-syntax 2.0.3 
atom-formatter-jsbeautify 1.1.2 
atom-mermaid 3.0.0 - disabled
atom-reverser 2.6.0 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
autocomplete-python 1.8.54 - disabled
block-comment-lines 0.2.4 
bottom-dock 0.4.4 - disabled
build-tools 4.5.7 - disabled
case-switch 2.2.4 
change-case 0.6.3 
color-picker 2.2.5 
compare-files 0.8.0 
css-clean 2.19.0 
css-snippets 1.1.0 
ctags-status 1.3.7 
docblockr 0.9.1 
emmet-simplified 2.5.0 - disabled
file-icons 2.0.15 
file-types 0.5.5 
git-log 0.4.1 
git-plus 7.3.0 
git-time-machine 1.5.6 
goto 1.8.3 
guess-indent 0.1.0 
highlight-line 0.12.0 
highlight-selected 0.12.0 
imdone-atom 2.1.18 - disabled
imdone-atom-github 0.1.11 - disabled
indent-guide-improved 1.4.12 
java-generator 2.2.3 - disabled
java-importer 1.4.1 - disabled
jekyll 1.4.3 - disabled
kerbal-config 0.4.1 
kite 0.10.0 - disabled
language-liquid 0.5.1 
language-lua 0.9.11 
language-markdown 0.19.1 
language-mediawiki 2.2.0 
language-minecraft-forge-cfg 0.1.2 - disabled
language-plantuml 0.2.0 
lines 0.13.1 
linter 1.11.23 
linter-javac 1.9.4 
linter-js-standard 3.8.1 
linter-jsonlint 1.3.0 
linter-lua 1.0.2 
linter-manager 0.2.12 
linter-markdown 3.1.0 - disabled
linter-python-pep8 0.2.0 - disabled
linter-sass-lint 1.7.4 
linter-shellcheck 1.4.3 
linter-tidy 2.3.0 
markdown-preview-enhanced 0.9.9 
markdown-preview-plus 2.4.3 - disabled
markdown-writer 2.6.4 
merge-conflicts 1.4.4 
minimap 4.26.8 
minimap-bookmarks 0.4.2 
minimap-codeglance 0.4.5 - disabled
minimap-find-and-replace 4.5.1 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.5.0 - disabled
minimap-linter 1.6.0 
minimap-pigments 0.2.2 
minimap-selection 4.4.0 
minimap-split-diff 0.3.5 
multi-cursor 2.1.5 
on-the-rocks 2.1.0 - disabled
one-dark-vivid-syntax 1.7.1 
open-recent 5.0.0 
pandoc-convert 1.1.0 - disabled
pigments 0.39.0 
plantuml-viewer 0.7.1 
project-plus 0.9.0 
project-viewer 1.0.9 - disabled
proto-repl 1.4.15 - disabled
proto-repl-charts 0.4.0 - disabled
python-tools 0.6.9 
release-notes 0.53.0 
slim-dark-ui 0.12.0 
split-diff 1.1.4 
symbol-gen 1.3.1 
sync-settings 0.8.1 
synced-sidebar 0.4.3 
terminal-plus 0.14.5 - disabled
todo-manager 0.2.10 - disabled
todo-show 1.11.0 
jwverzijden commented 6 years ago

It appears "resolved" after:

  1. closing all panes
  2. restart atom
  3. disable the package find-and-replace
  4. open a plantuml file and open the preview
  5. move preview around (notice no errors)

Looking at the code of find-and-replace line 45 we can see that it just assumes the pane is an editor pane, which the preview isn't causing the buffer property to be missing/undefined, leading to this error.

Honestly I think it would be best if find-and-replace does not screw up the editor when a property is missing. Nor should it search panes without checking if anything is being searched in the first place.