Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Uncaught TypeError: Cannot read property 'getPath' of undefined #128

Closed
kayone opened this issue Oct 29, 2015 · 10 comments
Closed

Uncaught TypeError: Cannot read property 'getPath' of undefined #128

kayone opened this issue Oct 29, 2015 · 10 comments

Comments

@kayone
Copy link

kayone commented Oct 29, 2015

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.1.0
System: Microsoft Windows 10 Pro
Thrown From: linter-jscs package, v3.1.2

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At /C:/Users/kayon/.atom/packages/linter-jscs/index.js:112

TypeError: Cannot read property 'getPath' of undefined
  at Function.fixString (C:\Users\kayon\.atom\packages\linter-jscs\index.js:112:24)
  at C:\Users\kayon\.atom\packages\linter-jscs\index.js:40:21
  at doNTCallback0 (node.js:416:9)
  at process._tickCallback (node.js:345:13)

Commands

     -1:24.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -1:18.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -1:18.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -1:17.6.0 tern:rename (atom-text-editor.editor.is-focused)
  2x -1:15 core:move-left (atom-text-editor.editor.mini.is-focused)
  2x -1:14.5.0 core:move-right (atom-text-editor.editor.mini.is-focused)
 18x -1:07.5.0 core:backspace (atom-text-editor.editor.mini.is-focused)
 20x -0:56.4.0 core:select-right (atom-text-editor.editor.mini.is-focused)
     -0:55.1.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:36.5.0 clipboard-history:copy (atom-text-editor.editor.mini.is-focused)
     -0:33.4.0 project-find:show (atom-text-editor.editor.is-focused)
     -0:31.6.0 find-and-replace:focus-next (atom-text-editor.editor.mini.is-focused)
     -0:30.7.0 core:paste (atom-text-editor.editor.mini.is-focused)
     -0:27.1.0 core:select-all (atom-text-editor.editor.mini.is-focused)
     -0:26.5.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:13.1.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-nucleus-dark-ui.find-visible)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "disabledPackages": [
      "language-objective-c",
      "language-c",
      "language-clojure",
      "language-java",
      "language-php",
      "welcome",
      "wrap-guide",
      "autoflow",
      "background-tips",
      "language-go",
      "language-perl",
      "language-ruby-on-rails",
      "language-sass",
      "language-toml",
      "spell-check"
    ],
    "openEmptyEditorOnStart": false,
    "audioBeep": false,
    "themes": [
      "nucleus-dark-ui",
      "one-dark-syntax"
    ]
  },
  "linter-jscs": {
    "fixOnSave": true,
    "onlyConfig": true,
    "displayAs": "warning"
  }
}

Installed Packages

# User
atom-beautify, v0.28.16
atom-handlebars, v1.2.0
atom-ternjs, v0.8.4
atom-yeoman, v0.3.15
auto-reveal-in-sidebar, v0.8.0
autocomplete-paths, v1.0.2
autosave, v0.23.0
clipboard-history, v0.6.6
color-picker, v2.0.13
file-types, v0.5.1
flex-tool-bar, v0.6.0
highlight-selected, v0.10.1
json-schema, v0.1.15
language-diff, v0.3.1
line-ending-selector, v0.3.0
linter, v1.9.1
linter-eslint, v3.2.0
linter-jscs, v3.1.2
linter-jshint, v1.2.1
linter-less, v2.2.0
local-history, v3.2.3
minimap, v4.15.0
minimap-find-and-replace, v4.3.1
minimap-git-diff, v4.1.8
minimap-hide, v0.3.0
minimap-highlight-selected, v4.3.1
nucleus-dark-ui, v0.6.6
omnisharp-atom, v0.25.9
pigments, v0.18.1
project-manager, v2.6.5
seti-icons, v0.4.5
sync-settings, v0.6.0
tool-bar, v0.1.9
underscorejs-snippets, v0.2.2
zentabs, v0.8.6

# Dev
No dev packages
@baelter
Copy link

baelter commented Oct 30, 2015

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.1.0
System: Mac OS X 10.11.1
Thrown From: linter-jscs package, v3.1.2

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At /Users/anders/.atom/packages/linter-jscs/index.js:136

TypeError: Cannot read property 'getPath' of undefined
    at Function.fixString (/Users/anders/.atom/packages/linter-jscs/index.js:136:24)
    at /Users/anders/.atom/packages/linter-jscs/index.js:71:18
    at doNTCallback0 (node.js:416:9)
    at process._tickCallback (node.js:345:13)

Commands

     -1:09.0 editor:auto-indent (atom-text-editor.editor.is-focused)
     -0:47.5.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-one-dark-ui)
     -0:47.4.0 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-one-dark-ui)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "atom-dark-syntax"
    ],
    "disabledPackages": [
      "json-schema",
      "autocomplete-ctags",
      "atom-ternjs"
    ],
    "excludeVcsIgnoredPaths": false,
    "projectHome": "/home/anders/Projects",
    "autoHideMenuBar": true,
    "ignoredNames": [
      ".git"
    ]
  },
  "linter-jscs": {
    "esnext": true,
    "preset": "crockford",
    "onlyConfig": true,
    "fixOnSave": true,
    "displayAs": "warning"
  }
}

Installed Packages

# User
angularjs, v0.3.3
autoclose-html, v0.19.0
autocomplete-modules, v1.3.1
autocomplete-paths, v1.0.2
autocomplete-python, v0.9.4
autocomplete-sass, v0.1.0
color-picker, v2.0.12
compare-files, v0.6.2
css-snippets, v0.9.0
ctags-status, v1.3.3
custom-title, v1.0.1
disable-keybindings, v0.5.0
docblockr, v0.7.3
editorconfig, v1.2.0
external-open, v0.6.1
file-icons, v1.6.11
filesize, v0.3.0
flex-tool-bar, v0.6.0
git-log, v0.4.1
go-plus, v3.5.1
highlight-selected, v0.10.1
language-diff, v0.3.1
language-groovy, v0.4.0
language-nginx, v0.6.1
language-qml, v1.0.0
language-rspec, v0.3.0
language-svg, v0.9.0
linter, v1.10.0
linter-clang, v3.3.0
linter-coffeelint, v1.1.2
linter-csslint, v1.1.0
linter-htmlhint, v0.2.1
linter-javac, v1.2.0
linter-jscs, v3.1.2
linter-jshint, v1.2.1
linter-jsonlint, v1.0.1
linter-less, v2.2.0
linter-php, v1.0.5
linter-pylint, v1.0.3
linter-ruby, v1.2.0
linter-scss-lint, v2.4.0
linter-shellcheck, v1.0.2
linter-xmllint, v0.0.7
local-history, v3.2.3
markdown-scroll-sync, v0.4.2
minimap, v4.15.1
minimap-bookmarks, v0.1.0
minimap-find-and-replace, v4.3.1
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.1
minimap-pigments, v0.1.7
minimap-selection, v4.3.1
pigments, v0.18.1
pretty-json, v0.4.1
project-manager, v2.6.5
regex-railroad-diagram, v0.10.4
restore-windows, v0.4.1
rspec-snippets, v0.4.0
simple-drag-drop-text, v0.3.0
svg-preview, v0.6.1
symbol-gen, v1.0.0
symbols-tree-view, v0.10.1
sync-settings, v0.6.0
synced-sidebar, v0.4.2
tabs-to-spaces, v0.11.1
tool-bar, v0.1.9
trailing-spaces, v0.3.2
zentabs, v0.8.6

# Dev
autocomplete-plus, v2.19.0

@leebenson
Copy link

+1

@cage1016
Copy link

cage1016 commented Dec 1, 2015

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4
System: Mac OS X 10.11.1
Thrown From: linter-jscs package, v3.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At /Users/cage/.atom/packages/linter-jscs/index.js:146

TypeError: Cannot read property 'getPath' of undefined
    at Function.fixString (/Users/cage/.atom/packages/linter-jscs/index.js:146:24)
    at /Users/cage/.atom/packages/linter-jscs/index.js:80:18
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
    at EventEmitter.ipc.sendSync (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/ipc.js:21:31)
    at BrowserWindow.RemoteMemberFunction [as emit] (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/remote.js:138:29)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:156:33)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:252:47)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

  3x -1:29.4.0 core:select-up (atom-text-editor.editor.is-focused)
  2x -1:28.4.0 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -1:24.6.0 core:backspace (atom-text-editor.editor.is-focused)
  3x -1:20.6.0 core:select-up (atom-text-editor.editor.is-focused)
  2x -1:20 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -1:19.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:19 core:save (atom-text-editor.editor.is-focused)
     -1:03.4.0 tree-view:remove (ol.tree-view.list-tree.has-collapsable-children.focusable-panel.multi-select)
     -0:49 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
  2x -0:48.4.0 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -0:47.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:47 core:save (atom-text-editor.editor.is-focused)
     -0:22.4.0 tree-view:move (span.name.icon.icon-file-directory)
     -0:20.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  3x -0:16 core:save (atom-text-editor.editor.is-focused)
     -0:03.3.0 tabs:close-all-tabs (li.tab.sortable.right-clicked)

Config

{
  "core": {
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ],
    "disabledPackages": [
      "language-python"
    ]
  },
  "linter-jscs": {
    "preset": "node-style-guide",
    "fixOnSave": true,
    "esnext": true
  }
}

Installed Packages

# User
MagicPython, v0.5.7
atom-beautify, v0.28.19
atom-material-syntax, v0.2.6
atom-material-ui, v1.0.0
auto-update-packages, v1.0.0
autocomplete-plus, v2.23.1
color-picker, v2.0.13
docblockr, v0.7.3
file-icons, v1.6.12
go-plus, v3.5.2
go-rename, v0.3.0
highlight-selected, v0.11.1
language-c, v0.50.1
language-docker, v1.1.3
language-gitignore, v0.2.0
language-protobuf, v0.5.0
language-shellscript, v0.20.0
linter, v1.11.3
linter-jscs, v3.2.0
open-recent, v4.0.1
pigments, v0.19.1
project-manager, v2.6.5
react, v0.12.10
tool-bar, v0.1.9
tool-bar-main, v0.0.8

# Dev
No dev packages

@adamreisnz
Copy link

+1

@Arcanemagus
Copy link
Member

Can somebody provide steps to reproduce this? The error should only be thrown if Atom can't determine an active TextEditor... which should be impossible if lint is being called.

@adamreisnz
Copy link

I had it happen to me when I did a find & replace in my entire project for var to let. That modified about 125 files, and after it was done the error showed up. If it happens again, I will try to recall what exact steps were taken.

@adamreisnz
Copy link

@Arcanemagus Happened again just now when doing a find & replace in project. I could reproduce this consistently, as long as one of the files that was affected by the replace was open in the editor.

@Arcanemagus
Copy link
Member

So you are doing Find and Replace on the entire project, including a file that you have open, and during/after the replace this error just pops up?

I wonder if linter is catching the change event, but since it isn't the active editor (there may not be one?) it fails to send the correct editor to the linter provider...

I'll try to debug this a bit more later tonight. It might just be a case of needing to bail out early if we don't have a valid editor.

@adamreisnz
Copy link

Yes, that's correct. I can reproduce it quite consistently now. Opened a file in my project, added a random unique string in it, then find the string in files, and hit replace all. The error then pops up during the find & replace operation.

@adamreisnz
Copy link

👍

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

No branches or pull requests

6 participants