Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'getAllowedLocations' of undefined #433

Open
vnt opened this issue Apr 13, 2017 · 9 comments
Open

Comments

@vnt
Copy link

vnt commented Apr 13, 2017

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.0-beta0 x64
Electron: 1.3.14
OS: Mac OS X 10.11.6
Thrown From: tabs package 0.105.4

Stack Trace

Uncaught TypeError: Cannot read property 'getAllowedLocations' of undefined

At /Applications/WebDesign/Atom Beta.app/Contents/Resources/app/node_modules/tabs/lib/layout.js:159

TypeError: Cannot read property 'getAllowedLocations' of undefined
    at itemIsAllowedInPane (/Applications/WebDesign/Atom Beta.app/Contents/Resources/app/node_modules/tabs/lib/layout.js:159:1)
    at Object.end (/Applications/WebDesign/Atom Beta.app/Contents/Resources/app/node_modules/tabs/lib/layout.js:42:1)
    at HTMLLIElement.TabView.element.ondragend (/Applications/WebDesign/Atom Beta.app/Contents/Resources/app/node_modules/tabs/lib/tab-view.js:62:1)

Commands

     -4:50.6.0 recent-projects:open (atom-workspace.workspace.scrollbars-visible-when-scrolling)
     -4:46.2.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
  2x -4:23.4.0 editor:toggle-soft-wrap (div.tool-panel.tree-view)
     -0:36.6.0 tool-bar:position-top (div.tool-bar.tool-bar-left.tool-bar-vertical.tool-bar-16px)
     -0:29.9.0 tool-bar:position-right (div.tool-bar.tool-bar-top.tool-bar-horizontal.tool-bar-16px)

Non-Core Packages

auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
busy-signal 1.3.0 
cakephp3-snippets 0.5.0 
chrome-color-picker 0.8.0 
color-picker 2.2.5 
color-tabs 0.1.8 
css-color-name 0.4.0 
file-icons 2.1.2 
file-types 0.5.5 
git-plus 7.4.0 
git-time-machine 1.5.9 
goto-definition 1.3.1 
intentions 1.1.2 
language-smarty 1.8.0 
linter 2.1.2 
linter-csslint 1.3.4 
linter-htmlhint 1.3.3 
linter-jshint 3.0.3 
linter-php 1.3.2 
linter-ui-default 1.2.2 
minimap 4.27.1 
minimap-find-and-replace 4.5.2 
open-recent 5.0.0 
pigments 0.39.1 
pinegrow-atom 0.3.1 
recent-projects 0.13.1 
simple-drag-drop-text 0.3.4 
tag 0.5.0 
todo-show 1.11.0 
tool-bar 1.1.0 
tool-bar-atom 1.7.0 
tree-view-autoresize 1.6.0 
@Ben3eeE
Copy link
Contributor

Ben3eeE commented Apr 13, 2017

What were you doing when you got the exception?

@vnt
Copy link
Author

vnt commented Apr 13, 2017

I was moving the project column from left to right

@rsese
Copy link

rsese commented Apr 13, 2017

Thanks @vnt - is the error reproducible for you? I just gave it a try with 1.17.0-beta0 and couldn't reproduce.

@cpierce
Copy link

cpierce commented May 19, 2017

just had the same thing happen on 1.17 stable.

@akodkod
Copy link

akodkod commented Jun 10, 2017

Got the same error as @vnt

@50Wliu
Copy link
Contributor

50Wliu commented Jun 12, 2017

@cpierce, @MrEmelianenko can you please paste the output of apm list --installed here? Thanks!


The commands list provided by @vnt suggests that this happens when workspace items aren't implementing the new Dock methods.

@cpierce
Copy link

cpierce commented Jun 12, 2017

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Aug 30, 2017

I accidentally reproduced this in safe mode when recording a gif and narrowing down steps for atom/github#1142

emitter has been disposed

@50Wliu
Copy link
Contributor

50Wliu commented Sep 7, 2017

return unless itemIsAllowedInPane(item, toPane ? target)
doesn't check to see if the item is valid before passing it to itemIsAllowedInPane (unlike another call on L17). Since the error is of undefined, that means that e.target.item is undefined. The end function is called by tab-view.coffee on drag end:
@element.ondragend = (e) -> layout.end e
, meaning that e is a dragend event. So I'm guessing in order for this to occur the target element being dragged (the tab) isn't associated with an item? Maybe the easiest fix is to just add an item? check, similar to the one on L17.

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

No branches or pull requests

6 participants