Open olmokramer opened 9 years ago
Ah this only happens when I'm not in a git project
Hmmm that is odd, it should have handled that fine. It might be due how we are handling no header set up. Will be looking into it.
So I'm very confused about this one. It is complaining at L70 and activeItem
being null or undefined but it has a check for that in that same line.
I actually wasn't able to reproduce this as described, it worked for me to open atom-ungit
on a repo that hasn't be initialized with git init
. However I was able to reproduce this when I disable and re enabled atom-ungit
with exact same error.
@olmokramer Did you do disable and reenable? Does this problem persist even after restarting atom after ungit installation?
I certainly didn't disable and enable the package again. But I think I didn't restart Atom after installing the package and trying it out. I'll see if I can get some reproducible steps.
Hey, I'm sorry I couldn't get back at you earlier. The check on L70 only checks if activeItem
is truthy, but not if the function you're calling exists. So activeItem was truthy, but didn't have a property getUri
. You can replace that line with:
if activeItem?.getUri?() is config.uri
This checks if activeItem isn't undefined
or null
, does the same for the function, if the function exists it executes it, and then it compares the result to config.uri
Thanks! I should have look into it more carefully...
Atom Version: 0.191.0 System: Unknown Windows Version Thrown From: atom-ungit package, v0.4.3
Uncaught TypeError: undefined is not a function
At C:\Users\Administrator\.atom\packages\atom-ungit\lib\atom-ungit.coffee:92
TypeError: undefined is not a function
at Socket.<anonymous> (C:\Users\Administrator\.atom\packages\atom-ungit\lib\atom-ungit.coffee:92:18)
at emitOne (events.js:82:20)
at Socket.emit (events.js:166:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:109:10)
at Pipe.onread (net.js:517:20)
-0:15.8 ungit:toggle (atom-text-editor.editor)
{
"core": {
"disabledPackages": [
"language-c",
"language-clojure",
"language-go",
"language-ruby",
"language-ruby-on-rails",
"language-toml",
"log-console",
"language-objective-c",
"language-mustache",
"autocomplete",
"jshint",
"language-perl",
"language-property-list",
"emmet",
"terminal-runner",
"file-type-icons",
"preview-plus",
"atom-lint",
"jslint",
"atom-terminal-panel",
"gitter",
"tidy-tabs"
],
"projectHome": "D:\\web",
"themes": [
"seti-ui",
"monokai-seti"
]
}
}
# User
atom-ternjs, v0.5.19
atom-ungit, v0.4.3
autoclose-html, v0.15.0
autocomplete-paths, v1.0.2
autocomplete-plus, v2.10.0
autocomplete-snippets, v1.2.0
code-links, v0.3.8
coffee-links, v0.1.0
coffee-refactor, v0.6.2
color-picker, v1.6.0
git-go, v1.0.1
highlight-selected, v0.9.1
js-refactor, v0.3.0
language-asp, v1.0.0
language-aspx, v0.4.0
language-batchfile, v0.4.0
language-ect, v0.2.0
language-gitignore, v0.2.0
language-livescript-edge, v1.0.0
linter, v0.12.0
linter-coffeelint, v0.2.1
linter-csslint, v0.0.11
linter-htmlhint, v0.0.13
linter-jshint, v0.1.2
linter-lsc, v1.1.2
linter-php, v0.0.12
minimap, v4.7.6
mocha, v0.0.5
monokai-seti, v0.7.0
navigate, v0.0.10
project-palette-finder, v2.4.16
project-ring, v0.19.6
refactor, v0.4.1
rest-client, v0.3.1
seti-ui, v0.6.3
Stylus, v0.7.0
webbox-color, v0.5.6
zentabs, v0.8.4
# Dev
No dev packages
Atom Version: 0.202.0 System: WS2030W7 Thrown From: atom-ungit package, v0.4.3
Uncaught TypeError: undefined is not a function
At C:\Users\th\.atom\packages\atom-ungit\lib\atom-ungit.coffee:92
TypeError: undefined is not a function
at Socket.<anonymous> (C:\Users\th\.atom\packages\atom-ungit\lib\atom-ungit.coffee:109:21)
at emitOne (events.js:82:20)
at Socket.emit (events.js:166:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:109:10)
at Pipe.onread (net.js:517:20)
-0:12.5.0 command-palette:toggle (atom-pane.pane.active)
-0:09.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:08.9.0 ungit:toggle (atom-pane.pane.active)
{
"core": {
"fileEncoding": "windows1252",
"disabledPackages": [
"tree-view",
"metrics",
"archive-view",
"bookmarks",
"welcome"
],
"themes": [
"atom-dark-ui",
"monokai"
]
}
}
# User
atom-ungit, v0.4.3
hex, v0.6.2
highlight-selected, v0.9.3
language-batch, v0.3.3
language-ini, v1.10.0
language-pascal, v0.7.0
monokai, v0.14.0
# Dev
No dev packages
Reproduction Steps
ungit:toggle
command from either the command palette or by runningatom.commands.dispatch(atom.views.getView(atom.workspace), 'ungit:toggle')
from the consoleIt says that
activeItem.getUri
on line 70 is undefined It points to theactiveItem.getUri()
function not being definedAtom Version: 0.187.0 System: linux 3.19.1-towo.3-siduction-amd64 Thrown From: atom-ungit package, v0.4.2
Stack Trace
Uncaught TypeError: undefined is not a function
Commands
Config
Installed Packages