lexcast / tree-view-autoresize

Autoresize the tree view when open/close folders
MIT License
13 stars 2 forks source link

Uncaught TypeError: this.getWidth is not a function with Nuclide TreeView #3

Closed alanzanattadev closed 8 years ago

alanzanattadev commented 8 years ago

[Enter steps to reproduce below:]

Just Enable the package with Nuclide TreeView activated

Atom Version: 1.7.3 System: Ubuntu 16.04 Thrown From: tree-view-autoresize package, v1.1.0

Stack Trace

Uncaught TypeError: this.getWidth is not a function

At /home/main/.atom/packages/tree-view-autoresize/lib/tree-view-autoresize.coffee:63

TypeError: this.getWidth is not a function
  at /home/main/.atom/packages/tree-view-autoresize/lib/tree-view-autoresize.coffee:63:35

Commands

     -0:17.8.0 settings-view:open (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "tree-view"
    ],
    "excludeVcsIgnoredPaths": false,
    "projectHome": "/home/main/Documents",
    "themes": [
      "one-dark-ui",
      "duotone-dark-sea-syntax"
    ]
  },
  "tree-view-autoresize": {}
}

Installed Packages

# User
atom-yeoman, v0.3.15
autoclose-html, v0.23.0
autocomplete-paths, v1.0.2
block-travel, v1.0.4
color-picker, v2.1.1
docker, v0.3.2
duotone-dark-sea-syntax, v1.0.0
file-icons, v1.7.11
git-checkout, v0.3.2
git-commit, v1.5.2
git-log, v0.4.1
haskell-grammar, v0.4.0
highlight-selected, v0.11.2
language-babel, v2.20.10
language-docker, v1.1.6
language-ini, v1.16.0
language-ocaml, v1.1.2
language-thrift, v1.0.2
merge-conflicts, v1.4.2
minimap, v4.23.5
minimap-codeglance, v0.4.5
nuclide, v0.134.0
open-terminal-here, v2.1.4
react, v0.15.0
sync-settings, v0.7.2
tool-bar, v0.4.0

# Dev
No dev packages
lexcast commented 8 years ago

this was on the package upgrade?

alanzanattadev commented 8 years ago

Sorry for the answer time I was very busy, I don't know but it's here even after atom reloading.

alanzanattadev commented 8 years ago

Seems like in resizeNuclideTreeView you have a scope problem, I don't write coffeescript, but "->" is function() {} right ? The setTimeout callback is a new scope and "this" is not anymore your package scope. You have to use bind(this) to send the package scope to the setTimeout callback, this.getWidth will exist then :)