oriolmirosa / open-files

Atom package to show the open files in the tree-view panel, mirroring the functionality in Sublime Text
https://atom.io/packages/open-files
MIT License
15 stars 10 forks source link

Uncaught TypeError: Cannot read property 'nextSibling' of undefined #18

Open solly0702 opened 7 years ago

solly0702 commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.2 x64 Electron: 1.3.15 OS: Mac OS X 10.12.5 Thrown From: open-files package 0.7.1

Stack Trace

Uncaught TypeError: Cannot read property 'nextSibling' of undefined

At /Users/Solly/.atom/packages/open-files/lib/open-files-pane-view.js:181

TypeError: Cannot read property 'nextSibling' of undefined
    at /packages/open-files/lib/open-files-pane-view.js:181:66
    at Config.module.exports.Config.observeKeyPath (/Applications/Atom.app/Contents/Resources/app/src/config.js:625:1)
    at Config.module.exports.Config.observe (/Applications/Atom.app/Contents/Resources/app/src/config.js:150:1)
    at /packages/open-files/lib/open-files-pane-view.js:140:21

Commands

 13x -1:57.7.0 core:move-left (input.hidden-input)
     -1:56.6.0 core:move-right (input.hidden-input)
  3x -1:56 core:backspace (input.hidden-input)
 12x -1:54.7.0 core:move-right (input.hidden-input)
 12x -1:53.8.0 core:move-left (input.hidden-input)
  6x -1:51.7.0 core:move-right (input.hidden-input)
     -1:50 core:save (input.hidden-input)
     -1:47 emmet:toggle-comment (input.hidden-input)
     -1:47 editor:toggle-line-comments (input.hidden-input)
     -1:46.7.0 core:save (input.hidden-input)
  7x -1:33.9.0 core:backspace (input.hidden-input)
     -1:31.2.0 core:save (input.hidden-input)
  5x -0:18.6.0 core:close (input.hidden-input)
     -0:12.7.0 fuzzy-finder:toggle-file-finder (atom-workspace.workspace.scrollbars-visible-when-scrolling.seti-compact.seti-icons.seti-roboto.theme-dracula-syntax.theme-seti-ui)
     -0:11.1.0 core:confirm (input.hidden-input)
  3x -0:09.4.0 core:move-down (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.6 
angularjs 0.4.0 
atom-beautify 0.29.26 
atom-bootstrap3 1.2.12 
atom-django 0.3.2 
atom-typescript 11.0.3 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
autocomplete-html-entities 0.1.0 
busy-signal 1.4.3 
color-picker 2.2.5 
css-snippets 1.1.0 
dracula-syntax 2.0.5 
emmet 2.4.3 
file-icons 2.1.7 
gitignore-snippets 0.2.5 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.2 
language-babel 2.65.1 
language-ejs 0.4.0 
language-haml 0.24.5 
language-typescript-grammars-only 1.6.0 
linter 2.1.4 
linter-cpplint 2.0.1 
linter-csslint 1.3.4 
linter-erb 1.1.0 
linter-eslint 8.2.1 
linter-haml 2.0.1 
linter-jshint 3.1.2 
linter-pycodestyle 2.0.2 
linter-python-pep8 0.2.0 
linter-ruby 1.2.5 
linter-sass-lint 1.7.4 
linter-scss-lint 3.1.0 
linter-ui-default 1.6.0 
merge-conflicts 1.4.5 
open-files 0.7.1 
open-in-browser 0.5.2 
open-recent 5.0.0 
pigments 0.39.1 
platformio-ide-terminal 2.5.1 
python-autopep8 0.1.3 
script 3.15.0 
seti-ui 1.8.0 
sort-lines 0.14.0 
todo-show 1.11.0 
tree-view-autoresize 2.1.0 
oriolmirosa commented 7 years ago

Hi, @solly0702, thanks for reporting the bug. I can't really reproduce this, but would you mind checking if the bug is still there with the latest version of the package (0.7.2)? If it is still present, could you tell me what files you have open at the time, and which you have closed recently? I'm particularly interested in non-traditional files, such as 'settings', 'deprecation cop', etc. Thanks!

gtozzi commented 7 years ago

This issue also appeared for me on 0.6.1. I then updated to 0.7.2 and it now seems to be gone, but I am not 100% sure, since it seems to be intermittent.

oriolmirosa commented 7 years ago

Thanks for the feedback, @gtozzi. I will leave the bug open for a couple of weeks longer. Please let me know if the problem re-appears.

gtozzi commented 7 years ago

The problem is back.

It worked for a few days and then it worked the whole morning. Then now, after no apparent reason, the problem appeared.

The file/line is now: .atom/packages/open-files/lib/open-files-pane-view.js:184

Trace: TypeError: Cannot read property 'nextSibling' of undefined at ~/.atom/packages/open-files/lib/open-files-pane-view.js:184:66 at Config.module.exports.Config.observeKeyPath (/usr/share/atom/resources/app/src/config.js:625:1) at Config.module.exports.Config.observe (/usr/share/atom/resources/app/src/config.js:150:1) at ~/.atom/packages/open-files/lib/open-files-pane-view.js:143:21

oriolmirosa commented 7 years ago

Thanks for letting me know about this, @gtozzi. Since I can't reproduce, could you let me know what files you have open at the time, and which you have closed recently? I'm particularly interested in non-traditional files, such as 'settings', 'deprecation cop', etc. Thanks!

gtozzi commented 7 years ago

Thanks for your reply! Sadly, it is not gone again, but it looks like I had nothing unusual opened.

Maybe it has something to do with the amount of files opened instead? When I open two windows, with a different project per window, here is what I get: http://picpaste.com/screen4.jpg

The 2nd-opened project has a blank file bar. I wasn't unable to exactly reproduce the error, but it looks like there is some issue anyway because disabling the plugin solves the problem. I am not 100% sure this is related, but I can remember I had two windows opened when it happened, and that's not a common use case for me.

gtozzi commented 7 years ago

It definitely has something to do with multiple panels opened.

Today I've split the window by mistake by dragging a file tab and there the bug came back. I only had 3 very normal and small files opened this time.

I've then restarted atom and tried hard to reproduce it without success :(.

oriolmirosa commented 7 years ago

Thanks again for your feedback, @gtozzi. I just published version 0.8.0. I've rewritten large parts of the package and I think it should be much more stable now. Since I can't reproduce the bug I'm not sure the recent changes take care of this, but I hope they do. Give it a spin and let me know if the problem persists. I'll leave the bug open for the moment.

JakClark-SpiralMedia commented 7 years ago

Thanks for the quick update but unfortunately 0.8.0 doesn't seem to fix this for me.

I too have been using the split panes and this is the only time I seem to experience the issue. Haven't been using Atom for very long, though, so don't know what useful information (if there is any) I can share.

oriolmirosa commented 7 years ago

Thanks for the report. After upgrading to 0.8.0, have you reloaded the window (View -> Developer -> Reload Window), or closed and restarted Atom? I am not able to reproduce the problem. I've been opening and closing files, editing them, having multiple panels, etc. and it works fine for me, so it's hard to know how to fix this if I can't identify the culprit. The most useful information would be to know what you were doing exactly when the problem occurred and what kinds of files and panels were open or just closed/modified. I'm sorry about the issue and I hope I can pin it down soon, but since I don't experience it myself I'm a bit at a loss.

gtozzi commented 7 years ago

Thank you again for your replies and for the update. Unfortunately, it just happened again.

This time I had no files opened. I switched from project A to project B, than I closed all tabs. When I opened the first file, I got the error.

New trace: ~/.atom/packages/open-files/lib/open-files-pane-view.js:265 TypeError: Cannot read property 'nextSibling' of undefined at ~/.atom/packages/open-files/lib/open-files-pane-view.js:265:69 at Config.module.exports.Config.observeKeyPath (/usr/share/atom/resources/app/src/config.js:625:1) at Config.module.exports.Config.observe (/usr/share/atom/resources/app/src/config.js:150:1) at ~/.atom/packages/open-files/lib/open-files-pane-view.js:224:21

Once the error behavior is triggered, it lasts until next atom restart.

oriolmirosa commented 7 years ago

Hmm... How did you switch between projects?

gtozzi commented 7 years ago

ctrl+alt+p (I am not sure if the hotkey is atom builtin or part of the project-plus package)

oriolmirosa commented 7 years ago

Ok, I now have the problem as well, including the empty 'open files' panels when opening new projects. As far as I can see, this is related to the project-plus package. @JakClark-SpiralMedia, if you have a minute, could you please let me know if you are using that package as well, or any other package for project management or that will open several Atom windows? I use the project-manager package and none of these issues seem to appear with it. In any case, now that I can sort of reproduce I'll investigate and try to find a fix. Thanks for the feedback!

oriolmirosa commented 7 years ago

I just published 0.8.1. This release takes care of the problems when the project is switched into the same window, so there shouldn't be any more duplication of 'open files' panels. I also took care of the only instance in which I could reproduce the Cannot read property 'nextSibling' of undefined error, which had to do with creating new files. I'm not sure if these changes will take care of all the problems you are experiencing, so would please let me know if this happens again? I'll leave the bug open for the moment. Thanks for all your help and sorry that this is taking so long to fix!

gtozzi commented 7 years ago

Thank you again for keeping improving this plugin. You don't have to be sorry: you are doing a very good job for free :D

Unfortunately, the problem is still there after upgrade & restart. I only had a single project open this time. I used the "close all tabs" function, then when I re-opened first file... bang The "close all tabs" + open seems to be a recurring pattern, yet I still can't find a sequence to reproduce the problem :(

~/.atom/packages/open-files/lib/open-files-pane-view.js:269

TypeError: Cannot read property 'nextSibling' of undefined
    at ~/.atom/packages/open-files/lib/open-files-pane-view.js:269:69
    at Config.module.exports.Config.observeKeyPath (/usr/share/atom/resources/app/src/config.js:625:13)
    at Config.module.exports.Config.observe (/usr/share/atom/resources/app/src/config.js:150:27)
    at ~/.atom/packages/open-files/lib/open-files-pane-view.js:228:21
gtozzi commented 7 years ago

Ok, I've found how to reproduce it:

  1. Load some project and have some files opened from that project
  2. Use the "Close all Tab" function form the "File" menu
  3. Open a new file from somewhere outside the project folder you had opened before
oriolmirosa commented 7 years ago

Thanks so much for this. I can reproduce now as well. I'm flying back after getting married last weekend but I'll try to work on this later this week.

gtozzi commented 7 years ago

:D Congrats for your wedding!!!

oriolmirosa commented 7 years ago

Ha ha! Thanks so much!

oriolmirosa commented 7 years ago

I hope this issue is resolved now. As the release notes for 0.8.2 say, I think the problem was that the removal of elements was done based on their indices, and when several were removed at the same time (as when you closed all tabs simultaneously) the delays and animations generated mismatches that created problems when new files were opened. I now assigned a unique id to each element, so hopefully the removal will be accurate and the problems will not appear again. I do not see the error anymore with 0.8.2, but do let me know if it creeps up again and I'll investigate more. Once again, thanks for all the feedback!

gtozzi commented 7 years ago

Thank you very much!

Maybe it is a bit early to say, but I confirm it seems to be solved for me too (at least on the previously reported reproducible case).