atom-autohide-tree-view
atom-autohide-tree-view copied to clipboard
Uncaught TypeError: Cannot read property 'dispose' of undefined
[Enter steps to reproduce below:]
- Open Atom
- Close any open files
- Install atom-autohide-tree-view
- Quit Atom
- Open atom by right-click text file and "Open with Atom"
- Close the file by clicking on the tab's close widget Here is where I get the alert:
Atom Version: 1.0.19 System: Microsoft Windows 8.1 Pro Thrown From: autohide-tree-view package, v0.25.1
Stack Trace
Uncaught TypeError: Cannot read property 'dispose' of undefined
At C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:25
TypeError: Cannot read property 'dispose' of undefined
at C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:25:28
at Set.forEach (native)
at CompositeDisposable.module.exports.CompositeDisposable.dispose (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:24:26)
at disableAutohide (C:\Users\dwayne\.atom\packages\autohide-tree-view\lib\autohide-tree-view.js:72:15)
at stop (C:\Users\dwayne\.atom\packages\autohide-tree-view\lib\main.js:117:43)
at updateActivationState (C:\Users\dwayne\.atom\packages\autohide-tree-view\lib\main.js:92:45)
at Emitter.module.exports.Emitter.emit (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
at PaneContainer.module.exports.PaneContainer.didDestroyPaneItem (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane-container.js:284:27)
at Pane.module.exports.Pane.removeItem (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane.js:410:17)
at Pane.module.exports.Pane.destroyItem (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\src\pane.js:466:16)
at HTMLDivElement.<anonymous> (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\tabs\lib\tab-bar-view.js:236:22)
at space-pen-ul.jQuery.event.dispatch (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
at space-pen-ul.elemData.handle (C:\Users\dwayne\AppData\Local\atom\app-1.0.19\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)
Commands
8x -1:21.4.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-atom-material-syntax-light.theme-atom-material-ui)
Config
{
"core": {
"themes": [
"atom-material-ui",
"base16-tomorrow-dark-theme"
]
},
"autohide-tree-view": {
"triggerAreaSize": 5
}
}
Installed Packages
# User
atom-material-ui, v0.6.2
atom-notifier, v0.4.3
auto-reveal-in-sidebar, v0.5.0
autohide-tree-view, v0.25.1
color-picker, v2.0.13
file-icons, v1.6.11
file-watcher, v0.4.0
minimap, v4.15.0
minimap-autohide, v0.10.1
seti-icons, v0.4.5
synced-sidebar, v0.4.2
# Dev
No dev packages
Hi, thanks for the report. I couldn't reproduce it with the steps you provided, but I'm on a Linux system. Seeing the stack trace, though, there seems to be some underlying problem. I'll go investigate
Now that I read the trace again I see the command above includes:
tree-view:reveal-active-file which rang a bell that I had also installed the auto-reveal-in-sidebar. These work fine together on my Mac but Ill try to uninstall the auto-reveal-in-sidebar on the Windows version and see if that is causing the conflict.
OK it's not the auto-reveal-in-sidebar package but I did a little disabling/reenabling of packages and this issue seems to go away when either autohide-tree-view or synced-sidebar is disabled/uninstalled so there is something between the two that conflicts.
Also, I didn't actually have this package (autohide-tree-view) installed on my Mac and when I installed it, the issue happens there too.
OK, thanks for finding that! I'll see if I can reproduce the issues when I install synced-sidebar.
I have the same stacktrace, but don't have synced-sidebar installed.
I can reproduce it with these steps (easier to do with a slower animation):
- Hover over the tree with your cursor
- Click on the tree while it is sliding open
- Slider will immediately be shut.
- Click on the pin to try to open the tree.
- Click on the pin again to try and pin the tree.
- Observe error.
Same stacktrace and have atom-material-ui and file-icons packages in common with the thread opener :)
Same stacktrace, given @dkerzig has narrowed it down to atom-material-ui and file-icons in common, the only one of those two I have in common with him is file-icons.
My steps to reproduce. Open atom with the package installed. Open any file (by any means). Press the keyboard shortcut to Reveal in sidebar. Click back to the document (so sidebar autohides). Then close the file using command-W. Crash.
Any update on fixing this?
+1
Important note: I'm using "tree-view-background" as well.
Uncaught TypeError: Cannot read property 'dispose' of undefined
C:\Users\Tyson\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:25
TypeError: Cannot read property 'dispose' of undefined
at C:\Users\Tyson\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:25:28
at Set.forEach (native)
at CompositeDisposable.module.exports.CompositeDisposable.dispose (C:\Users\Tyson\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\event-kit\lib\composite-disposable.js:24:26)
at disableAutohide (C:/Users/Tyson/.atom/packages/autohide-tree-view/lib/autohide-tree-view.js:36:15)
at toggleAutohide (C:/Users/Tyson/.atom/packages/autohide-tree-view/lib/autohide-tree-view.js:56:26)
at HTMLDivElement.<anonymous> (C:/Users/Tyson/.atom/packages/autohide-tree-view/lib/pin-view.js:8:41)
at HTMLDivElement.wrapper (C:/Users/Tyson/.atom/packages/autohide-tree-view/lib/utils.js:17:10)
The error was thrown from the autohide-tree-view package. This issue has already been reported.
I had an empty project open, went to settings to re-iscover how to register a background. Ctrl+ Shift+ P to bring up the command paletTe. I typed/clicked to register an image while attempting to get the tree view to stay out by pinning and stretching.
I am getting this issue with the following:
- Make sure the tree view is hidden and mouse is not hovering the tree view area.
- Make the tree view appear by toggling through (View Toggle Tree View) or hotkey.
- Click the pin.
This is an issue with the following function disableAutohide, where disposables is never initialized due to enableAutohide not been set before. Normally you could expect this function to be called first.
I think the tree-view object is being disposed when you use "Reveal in Tree-View" on an open file. Steps:
- Open Atom, open any file
- Reveal in Tree-View
- Close file.
I have this after few hours of work on three "pane" when closing last opened "pane".
The issue is actually here: https://github.com/atom/event-kit/blob/master/src/composite-disposable.coffee#L41. will look at forking and raising a PR against Event Kit
I think we should make sure the disposable element is defined before calling dispose on it
https://github.com/atom/event-kit/pull/28
Addresses adding objects to CompositeDisposable on EventKit that do not have .dispose(). If accepted, will raise PR here to rectify adding non-compliant objects
It happened to me when i had a couple of open tabs, then i close all of them. After i closed the last one, it showed me the error.