JsonHunt / save-commands

Assign parametrized shell commands to file globs to be automatically run whenever the file is saved
MIT License
20 stars 11 forks source link

Uncaught TypeError: undefined is not a function #17

Closed QinMing closed 8 years ago

QinMing commented 9 years ago

I got this exception when I upgraded to the newest version, and pressed cmd-s to save a .go file. Actually my command goimports has been executed very well. The exception pops up afterward.

Thanks!

Atom Version: 0.207.0 System: Mac OS X 10.10.3 Thrown From: save-commands package, v0.6.2

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/qinming/.atom/packages/save-commands/lib/atom-save-commands.coffee:107

TypeError: undefined is not a function
  at Object.module.exports.AtomSaveCommands.executeCommand (/Users/qinming/.atom/packages/save-commands/lib/atom-save-commands.coffee:107:44)
  at iterate (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js:146:13)
  at Object.async.eachSeries (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js:162:9)
  at /Users/qinming/.atom/packages/save-commands/lib/atom-save-commands.coffee:259:12
  at /Users/qinming/.atom/packages/save-commands/lib/atom-save-commands.coffee:276:5
  at FSReqWrap.oncomplete (fs.js:77:15)

Commands

 16x -7:02.1.0 core:select-left (atom-text-editor.editor.is-focused)
     -6:59.7.0 core:save (atom-text-editor.editor.is-focused)
     -6:59.1.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -6:59.1.0 core:cancel (atom-text-editor.editor.is-focused)
     -6:58.5.0 core:cut (atom-text-editor.editor.is-focused)
 10x -6:58.2.0 core:move-down (atom-text-editor.editor.is-focused)
  6x -6:56 core:select-left (atom-text-editor.editor.is-focused)
     -6:54.8.0 core:backspace (atom-text-editor.editor.is-focused)
  6x -6:54.5.0 core:move-down (atom-text-editor.editor.is-focused)
     -6:53.5.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
  2x -6:53.1.0 core:select-right (atom-text-editor.editor.is-focused)
     -6:52.4.0 core:backspace (atom-text-editor.editor.is-focused)
     -6:51.9.0 core:save (atom-text-editor.editor.is-focused)
     -6:51.2.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -6:51.2.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:01.4.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-monokai-ming"
    ],
    "disabledPackages": [
      "css-color-highlight",
      "autocomplete",
      "autocomplete-snippets"
    ]
  },
  "save-commands": {
    "commands": [
      "**/*.go : /Users/qinming/gopath/bin/goimports -w {relFullPath}"
    ],
    "suppressPanel": true
  }
}

Installed Packages

# User
color-picker, v2.0.4
file-types, v0.4.0
highlight-line, v0.10.2
highlight-selected, v0.9.3
minimap, v4.9.4
minimap-bookmarks, v0.1.0
minimap-find-and-replace, v4.2.0
minimap-git-diff, v4.1.3
minimap-highlight-selected, v4.3.0
minimap-selection, v4.2.0
pigments, v0.4.5
save-commands, v0.6.2
seti-monokai-ming, v0.3.1
seti-ui, v0.7.1

# Dev
No dev packages
cperryk commented 9 years ago

+1

jun-yin commented 9 years ago

+1 pretty annoying

QinMing commented 9 years ago

I just commented 3 lines in lib/atom-save-commands.coffee that contains div. It magically works fine

cperryk commented 9 years ago

Thanks, @QinMing. That solution also worked for me. For anyone else's reference, here are the three lines I commented out on atom-save-commands.coffee:

107: div = atom.views.getView(atom.workspace).find('.save-result') 114: div.scrollTop div.prop("scrollHeight") 124: div.scrollTop div.prop("scrollHeight")

jorgebg commented 9 years ago

@cperryk it didn't work for me :cry:

QinMing commented 9 years ago

How it didn't work? Can you provide more detail about reproducing your problem? On Jul 24, 2015 8:24 AM, "Jorge Barata" notifications@github.com wrote:

@cperryk https://github.com/cperryk it didn't work for me [image: :cry:]

— Reply to this email directly or view it on GitHub https://github.com/JsonHunt/save-commands/issues/17#issuecomment-124558000 .

ryanhovland commented 9 years ago

I'm also getting errors. Commenting out those three lines made it work.

JsonHunt commented 8 years ago

fixed