Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
YurySolovyov opened this issue May 8, 2015 · 20 comments
Closed

Comments

@YurySolovyov
Copy link

TEMPORARY WORKAROUND:
$ apm install highlight-selected@0.9.1
  1. open Atom
  2. try to open any file

Atom Version: 0.199.0-fabfd2a
System: linux 3.13.0-52-generic
Thrown From: highlight-selected package, v0.9.2

Stack Trace

Uncaught TypeError: Cannot read property 'dispose' of undefined

At /usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:25

TypeError: Cannot read property 'dispose' of undefined
    at /usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:25:28
    at Set.forEach (native)
    at CompositeDisposable.module.exports.CompositeDisposable.dispose (/usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:24:26)
    at MinimapHighlightSelectedView.module.exports.HighlightedAreaView.subscribeToActiveTextEditor (/home/user/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:60:15)
    at /home/user/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:33:24
    at Emitter.module.exports.Emitter.emit (/usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
    at /usr/local/share/atom/resources/app.asar/src/pane-container.js:343:34
    at Emitter.module.exports.Emitter.emit (/usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
    at Pane.module.exports.Pane.setActiveItem (/usr/local/share/atom/resources/app.asar/src/pane.js:234:22)
    at Pane.module.exports.Pane.removeItem (/usr/local/share/atom/resources/app.asar/src/pane.js:368:16)

Commands

     -0:35.3.0 fuzzy-finder:toggle-file-finder (atom-pane.pane.active)
     -0:32.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:19.1.0 fuzzy-finder:toggle-file-finder (atom-pane.pane.active)
     -0:16.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "audioBeep": false,
    "disabledPackages": [
      "release-notes"
    ],
    "autoHideMenuBar": true
  },
  "highlight-selected": {
    "onlyHighlightWholeWords": true
  }
}

Installed Packages

# User
highlight-selected, v0.9.2
language-javascript-better, v1.5.0
minimap, v4.8.0
minimap-highlight-selected, v4.2.1

# Dev
No dev packages
kmyl added a commit to kmyl/event-kit that referenced this issue May 9, 2015
@v3ss0n
Copy link

v3ss0n commented May 11, 2015

Same here.

  • open atom
  • Clicking any tab.

abe33 added a commit to atom-minimap/minimap-highlight-selected that referenced this issue May 11, 2015
@abe33
Copy link

abe33 commented May 11, 2015

Ok, so the problem is much complex than I thought, looks like the fix doesn't really work for the first editor opened in a pane (the tab is visible, but the editor content doesn't show up).

For the time being, I recommend turning the minimap-highlight-selected plugin off.

@richrace Maybe it's time to think of a service for highlight-selected so that I don't have to patch the view the way I do?

@YurySolovyov
Copy link
Author

For the time being, I recommend turning the minimap-highlight-selected plugin off.

That's what I've done

@richrace
Copy link
Member

Hmm, I don't get this in Mac with Atom 0.198.0. Everything seems to be working fine.

@abe33 I agree. I'll see what I can do this week.

@abe33
Copy link

abe33 commented May 11, 2015

Looks like the issue is also triggered when the minimap plugin is disabled:

Here's the stack:

TypeError: Cannot read property 'dispose' of undefined
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:25:28
  at Set.forEach (native)
  at CompositeDisposable.module.exports.CompositeDisposable.dispose (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/composite-disposable.js:24:26)
  at HighlightedAreaView.module.exports.HighlightedAreaView.subscribeToActiveTextEditor (/Users/cedric/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:27:29)
  at /Users/cedric/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:13:8
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:343:34
  at Pane.module.exports.Pane.observeActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:182:7)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:342:42
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at PaneContainer.module.exports.PaneContainer.setActivePane (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:218:22)
  at Pane.module.exports.Pane.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:607:15)
  at Pane.module.exports.Pane.focus (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:193:21)
  at atom-pane.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:59:23)

For me these lines should be written like this instead:

if editor = @getActiveEditor()
  @selectionSubscription.add editor.onDidAddSelection =>
    @handleSelection()
  @selectionSubscription.add editor.onDidChangeSelectionRange =>
    @handleSelection()

Because in the current version, when the text editor doesn't exist, undefined is added to the composite disposable.

@abe33
Copy link

abe33 commented May 11, 2015

I omitted to give the Atom version: 0.199.0-f1f8c3d (freshly built from master this morning).

@v3ss0n
Copy link

v3ss0n commented May 11, 2015

yes , happen to me on 0.199.0-f1f8c3d too , i skipped 197 and 198.

@stramel
Copy link

stramel commented May 11, 2015

I am getting this as well

OS: Ubuntu 14.04
Atom version: 0.199.0-f1f8c3d
highlight-selected: 0.9.2

@kolAflash
Copy link

No bug with:
Atom: 0.196.0
highlight-selected package: 0.9.2

Bug reproducibly appears with:
Atom: 0.198.0
highlight-selected package: 0.9.2
Steps to reproduce:

  1. open settings
  2. close settings
  3. bug appears

My OS: openSUSE Linux 13.2 (Kernel 3.16.7)

@yar0d
Copy link

yar0d commented May 12, 2015

I'm having trouble too with Atom 0.198.0/highlight-selected 0.9.2 on Arch Linux when I open Atom and click a tab. I've removed highlight-selected and disabled minimap-highlight-selected plugins to work with Atom.

@YurySolovyov
Copy link
Author

I've just rolled back package versions and it works fine:

$ apm install highlight-selected@0.9.1
Installing highlight-selected@0.9.1 to /home/user/.atom/packages ✓
$ apm install minimap-highlight-selected@4.2.3
Installing minimap-highlight-selected@4.2.3 to /home/user/.atom/packages ✓
$ atom -v
0.199.0-ccc6b17

@kolAflash
Copy link

Going back to highlight-selected@0.9.1 helped for me too. Must be something changed between 0.9.1 and 0.9.2!

@v3ss0n
Copy link

v3ss0n commented May 12, 2015

Yes going back to 0.9.1 fixed it! thank you @YuriSolovyov for discovering that!
Going to compare diffs.

@shaungrady
Copy link

I'm getting this error in Atom 0.199.0 by opening the Settings and then closing the the Settings tab. The error is thrown and Settings remains open. I never saw this error before updating to 0.199.0. On OS X.

@190n
Copy link

190n commented May 15, 2015

Also getting this on Atom 0.199, Ubuntu 14.10.

@refrain4121
Copy link

Get this problem too on Atom 0.199, Windows.

@xpol
Copy link

xpol commented May 15, 2015

  1. Enabled highlight-selected.
  2. Restart Atom,
  3. Add a project folder to tree view (this make it easy to open a file).
  4. Close all tabs
  5. Open a file by double click items in the tree view.

Got: the file can't open, just the tab shows up.

And disable highlight-selected, try again, then the first file opens both tab and editor view shows.

I have tested both Windows 7 and Mac OSX.

@v3ss0n
Copy link

v3ss0n commented May 15, 2015

current work around is to downgrade to highlight-select to version 0.9.1 using apm as discovered by
@YuriSolovyov

$ apm install highlight-selected@0.9.1

Yuri , can you edit that work around for newcomers in your op ?

@YurySolovyov
Copy link
Author

@v3ss0n sure, thanks for the tip

richrace added a commit that referenced this issue May 15, 2015
@YurySolovyov
Copy link
Author

Works just fine, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests