SavageCore / atom-meld

:atom: package to diff files via Meld
https://atom.io/packages/atom-meld
MIT License
3 stars 2 forks source link

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

Closed a7madgamal closed 7 years ago

a7madgamal commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.4 x64 Electron: 1.3.13 OS: Mac OS X 10.12.3 Thrown From: atom-meld package 0.3.2

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At /Users/mido/.atom/packages/atom-meld/lib/atom-meld.coffee:102

TypeError: Cannot read property 'getPath' of undefined
    at Object.diff_from_tree_active (/packages/atom-meld/lib/atom-meld.coffee:102:54)
    at /packages/atom-meld/lib/atom-meld.coffee:60:10)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:3:59)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/app.asar/src/atom-environment.js:1170:28)
    at EventEmitter.outerCallback (/app.asar/src/application-delegate.js:333:25)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -0:39.1.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-dark-devtools-syntax.theme-one-dark-ui)
     -0:03.1.0 atom-meld:diff-from-tree-active (span.name.icon.npm-icon.medium-red)

Non-Core Packages

activate-power-mode 1.2.0 
atom-beautify 0.29.17 
atom-chai-snippets 0.3.0 
atom-easy-jsdoc 4.10.0 
atom-jade 0.3.0 
atom-material-syntax-dark 0.2.7 
atom-material-ui 1.3.9 
atom-meld 0.3.2 
atom-package-manager 1.15.2 
atom-pair 2.0.10 
atom-spotified 0.7.1 
atom-terminal 0.8.0 
atom-terminal-panel 4.4.4 
atom-ternjs 0.17.0 
atomatigit 1.5.5 
auto-update-packages 1.0.1 
autoclose-html 0.23.0 
autocomplete-html-entities 0.1.0 
autocomplete-json 5.2.0 
autocomplete-modules 1.6.7 
autocomplete-paths 1.0.5 
autohide-tree-view 0.25.1 
chary-tree-view 0.2.3 
clear-syntax 0.6.0 
clipboard-plus 0.5.1 
code-links 0.4.0 
coffee-links 0.1.0 
coral-blue-syntax 0.2.0 
css-snippets 1.1.0 
dark-devtools-syntax 0.1.4 
dark-flat-ui 1.2.4 
diff-pane 0.1.0 
docblockr 0.9.1 
dracula-theme 2.0.0 
editing-diff 0.2.1 
editor-background 1.2.37 
editor-stats 0.17.0 
editorconfig 2.2.0 
file-icons 2.0.15 
file-types 0.5.5 
flatwhite-syntax 0.8.0 
fold-search-results 1.0.5 
fonts 2.0.0 
genesis-syntax 1.0.9 
genesis-ui 0.5.0 
git-blame 0.4.11 
git-control 0.8.2 
git-diff-details 1.4.0 
git-projects 1.17.0 
git-status 0.3.4 
git-time-machine 1.5.4 
googlesearch 1.5.0 
goto-last-edit 0.3.2 
gruvbox-plus-syntax 1.3.1 
highlight-column 0.5.2 
highlight-selected 0.12.0 
hyperclick 0.0.40 
incremental-search 5.2.1 
javascript-snippets 1.2.1 
js-hyperclick 1.10.1 
jshint 1.8.6 
language-diff 0.7.0 
language-dots 0.0.4 
language-ignore 1.5.2 
language-markdown 0.19.1 
language-pug 0.0.19 
language-svg 0.9.2 
last-cursor-position 0.9.0 
line-diff-details 1.4.0 
linter 1.11.21 
linter-coffeelint 1.2.1 
linter-eslint 8.1.0 
linter-jshint 3.0.2 
linter-json-lint 0.1.1 
linter-markdown 3.1.0 
linter-pug-lint 0.2.0 
linter-scss-lint 3.0.4 
live-archive 0.1.15 
markdown-preview-plus 2.4.1 
markdown-scroll-sync 2.1.2 
markdown-writer 2.6.3 
method-separator 0.1.4 
minimap 4.26.8 
minimap-autohide 0.10.1 
minimap-find-and-replace 4.5.1 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.5.0 
monokai 0.20.0 
npm-docs 0.2.0 
npm-helper 0.8.9 
npm-plus 0.4.0 
open-in-browser 0.4.7 
open-in-sourcetree 0.1.8 
open-recent 5.0.0 
outlander-syntax 2.0.0 
package-cop 0.2.10 
package-list 0.1.2 
package-sync 1.1.0 
package-sync-plus 0.1.2 
path-hyperclick 0.3.0 
pigments 0.39.0 
polaris-syntax 0.1.0 
pretty-json 1.6.1 
project-manager 3.3.3 
robin-hood-syntax 1.0.0 
scope-inspector 1.0.1 
scroll-searcher 5.1.0 
seti-syntax 1.1.2 
seti-ui 1.6.1 
simple-drag-drop-text 0.3.4 
slim-dark-ui 0.12.0 
source-preview 0.5.0 
source-preview-pug 0.2.0 
split-diff 1.1.2 
svg-preview 0.11.0 
synced-sidebar 0.4.3 
tab-smart-sort 0.3.0 
terminal-panel 1.14.1 
terminal-plus 0.14.5 
tool-bar 1.0.1 
tool-bar-almighty 0.8.1 
tool-bar-atom 1.7.0 
tool-bar-main 0.0.10 
tree-view-copy-relative-path 1.0.1 
tree-view-git-status 1.3.1 
tree-view-search-bar 0.1.2 
twilight-syntax 0.7.0 
useful-context-menu 0.6.1 
vertical-tabs 1.0.2 
SavageCore commented 7 years ago

Do you have any steps to reproduce this?

a7madgamal commented 7 years ago

sorry I can't remember exactly, I just tried to use the package. but to help you narrow it I will ask 2 questions :)

SavageCore commented 7 years ago

I don't have a Mac to test with (and they seem to hate VM) but there is a fork for MacOS, I would install that. As long as from terminal you can run meld then package should work fine.

It should work fine across multiple projects within same window, I do it all the time.

What happens if you execute atom.workspace.getActiveTextEditor() in Atom dev tools console? It should print a text editor object. If it does atom.workspace.getActiveTextEditor().getPath() should return full file path to current active file.

You did have a file open correct? If for example you were looking at the settings page and tried to diff with active file this error would appear. I'll fix that shortly.

a7madgamal commented 7 years ago

I found this in the console /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:357 Uncaught BufferedProcessError: Failed to spawn command meld. Make sure meld is installed and on your PATH

I installed meld using brew and I think it has some issues, it opens from the console but with some issues and doesn't close cleanly

I guess you can ignore this issue for now unless someone else confirms it, sorry for your trouble :)

a7madgamal commented 7 years ago

I know about the fork long ago, how can I run it from the terminal?