olmokramer / atom-autohide-tree-view

Hides most of the tree view, reveal it on hover
MIT License
38 stars 8 forks source link

Uncaught TypeError: Cannot read property 'dispose' of undefined #57

Open iamzam opened 8 years ago

iamzam commented 8 years ago

[Enter steps to reproduce below:]

  1. Open Atom
  2. Close any open files
  3. Install atom-autohide-tree-view
  4. Quit Atom
  5. Open atom by right-click text file and "Open with Atom"
  6. 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
olmokramer commented 8 years ago

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

iamzam commented 8 years ago

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.

iamzam commented 8 years ago

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.

olmokramer commented 8 years ago

OK, thanks for finding that! I'll see if I can reproduce the issues when I install synced-sidebar.

dannyfritz commented 8 years ago

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):

  1. Hover over the tree with your cursor
  2. Click on the tree while it is sliding open
  3. Slider will immediately be shut.
  4. Click on the pin to try to open the tree.
  5. Click on the pin again to try and pin the tree.
  6. Observe error.
wottpal commented 8 years ago

Same stacktrace and have atom-material-ui and file-icons packages in common with the thread opener :)

andyjeffries commented 8 years ago

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.

andyjeffries commented 8 years ago

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.

andyjeffries commented 8 years ago

Any update on fixing this?

devmao commented 8 years ago

+1

ttaylordev commented 8 years ago
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.

ricardowong commented 8 years ago

I am getting this issue with the following:

  1. Make sure the tree view is hidden and mouse is not hovering the tree view area.
  2. Make the tree view appear by toggling through (View Toggle Tree View) or hotkey.
  3. 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.

technicalities commented 8 years ago

I think the tree-view object is being disposed when you use "Reveal in Tree-View" on an open file. Steps:

  1. Open Atom, open any file
  2. Reveal in Tree-View
  3. Close file.
MateuszG commented 8 years ago

I have this after few hours of work on three "pane" when closing last opened "pane".

ardelio commented 8 years ago

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

ardelio commented 8 years ago

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

ghost commented 8 years ago

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.