Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: undefined is not a function #34

Closed
victorhooi opened this issue Dec 12, 2014 · 9 comments
Closed

Uncaught TypeError: undefined is not a function #34

victorhooi opened this issue Dec 12, 2014 · 9 comments

Comments

@victorhooi
Copy link

Uncaught TypeError: undefined is not a function

Atom Version: 0.155.0
System: Mac OS X 10.10.1
Thrown From: save-session package, v0.11.0

Steps To Reproduce

  1. Attempt to close a file in Atom.
  2. His yes in the do you want to save changes prompt. This error then came up.

Stack Trace

At /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/pane.js:490

TypeError: undefined is not a function
  at Object.module.exports.Pane.promptToSaveItem [as defaultSavePrompt] (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/pane.js:490:23)
  at Pane.promptToSaveItem (/Users/victorhooi/.atom/packages/save-session/lib/save-prompt.coffee:21:15)
  at Pane.module.exports.Pane.destroyItem (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/pane.js:442:18)
  at Pane.module.exports.Pane.destroyActiveItem (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/pane.js:422:12)
  at Workspace.module.exports.Workspace.destroyActivePaneItem (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/workspace.js:604:35)
  at Workspace.module.exports.Workspace.destroyActivePaneItemOrEmptyPane (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/workspace.js:643:21)
  at atom-workspace.atom.commands.add.core:close (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/workspace-element.js:284:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/window-event-handler.js:167:20)

/cc @atom/core

@mpeterson2
Copy link
Owner

I'm not getting this error on version 0.157.0. Do you mind updating and trying again? I don't believe anything has changed in their API for this since I wrote that part, so it shouldn't make a difference, but it's worth a try.

  1. If that doesn't work, what are the nondefault settings you have for save session?
  2. Is it happening every time you close a file (that can be saved) or just sometimes?
  3. Does it throw any errors when you click cancel or Don't Save?

@jparkerweb
Copy link

Happening to me as well
Atom version 0.161.0
Save Session version 0.11.0

@chetmurphy
Copy link

+1. Also happening to me.
Atom version 0.161.0
Save Session disabled [Update: but Atom not restarted - see next comment]

@chetmurphy
Copy link

More info:

Steps: 1) Open a file and edit with Saved Session enabled. 2) Close file and choose Save.

File is not closed and Uncaught TypeError is thrown after a delay ~ 5 seconds. File is also not saved and attempting to close it again results in the same exception.

Restarting Atom with Saved Session disabled appears to fix the problem. Just disabling Saved Session does not fix the issue. Atom needs to be restarted with Saved Session disabled.

Atom version 0.162.0

@mpeterson2
Copy link
Owner

Hmm. I still can't get this error to happen. Is there any chance one of you could debug this and find what the issue is?

@chetmurphy
Copy link

On 12/19/2014 11:47 AM, Michael Peterson wrote:

Hmm. I still can't get this to work. Is there any chance you could
debug this?


Reply to this email directly or view it on GitHub
#34 (comment).

Hmm... It appears that the hack in save-prompt.coffee:21 to call
Pane.prototype.promptToSaveItem is not fully working. It does call
Pane.prototype.promptToSaveItem but the value of 'this' in
promptToSaveItem does not look like a panel object and this.saveItem is
undefined.

  1. this: Object
    1. activate: function () {
    2. addListeners: function () {
    3. defaultSavePrompt: function (item) {
    4. disable: function () {
    5. enable: function () {
    6. enableTemp: function () {
    7. proto: Object
      1. defineGetter: function defineGetter() { [native code] }
      2. defineSetter: function defineSetter() { [native code] }
      3. lookupGetter: function lookupGetter() { [native code] }
      4. lookupSetter: function lookupSetter() { [native code] }
      5. constructor: function Object() { [native code] }
      6. hasOwnProperty: function hasOwnProperty() { [native code] }
      7. isPrototypeOf: function isPrototypeOf() { [native code] }
      8. propertyIsEnumerable: function propertyIsEnumerable() {
        [native code] }
      9. toLocaleString: function toLocaleString() { [native code] }
        1. toString: function toString() { [native code] }
        2. valueOf: function valueOf() { [native code] }
        3. get proto: function proto() { [native code] }
        4. set proto: function proto() { [native code] }

--Chet

@mpeterson2
Copy link
Owner

Is this still an issue?

@chetmurphy
Copy link

No.

@mpeterson2
Copy link
Owner

Okay cool. Going to close this than.

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

No branches or pull requests

4 participants