You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Uncaught TypeError: Cannot read property 'nodeName' of undefined #85
Uncaught TypeError: Cannot read property 'nodeName' of undefined
At /usr/share/atom/resources/app.asar/node_modules/notifications/lib/command-logger.js:81
TypeError: Cannot read property 'nodeName' of undefined
at CommandLogger.module.exports.CommandLogger.logCommand (/usr/share/atom/resources/app.asar/node_modules/notifications/lib/command-logger.js:81:38)
at /usr/share/atom/resources/app.asar/node_modules/notifications/lib/command-logger.js:33:24
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:235:20)
at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app.asar/src/command-registry.js:163:19)
at encoding-selector-status.<anonymous> (/usr/share/atom/resources/app.asar/node_modules/encoding-selector/lib/encoding-status-view.js:40:25)
I'm having the same issue on Atom 1.0.2 - edd8ecc (built by @yuki-takei that solve #6306)
When I try to put it in fullscreen or saving a file or when I click on the encoding setting on the status bar, i get the same exception.
I have haskell-language, haskell-ide, haskell-ghc-mod and some themes.
The saving action doesn't throw any exceptions if I try to save any file, except when it's a Haskell (.hs) source.
I got some more information. I don't know the atom infrastructure, but doesn't seem like a bug in this package. Seems like Atom has a problem.
In my case, I had the @yuki-takei's version which solves atom/atom#6306, then I tried to do that by myself, inspiring (copying) the code from Yuki.
Then I forked the main atom repo and applied the same code that Yuki did. However, the problem continued. I suppose it happens because Yuki and me are using a newer version of Electron (instead of the old atom shell), in my case, 0.29.3, and Chrome 43 doesn't know how to handle Object.create event where typeof event is CustomEvent. Yuki tried to copy the properties from one object to another, but it didn't solve it completely.
This description looks like a soap opera, but still.
An 'event' object was still required, and the notifications package wasn't receiving it.
What I did to solve was to explicitly pass another object on command-registry.coffee, in the function @handleCommandEvent, where the obejct syntheticEvent is constructed, so the object looks like this:
syntheticEvent = Object.create {},
eventPhase: value: Event.BUBBLING_PHASE
currentTarget: get: -> currentTarget
target: value: currentTarget
preventDefault: value: ->
originalEvent.preventDefault()
stopPropagation: value: ->
originalEvent.stopPropagation()
propagationStopped = true
stopImmediatePropagation: value: ->
originalEvent.stopImmediatePropagation()
propagationStopped = true
immediatePropagationStopped = true
abortKeyBinding: value: ->
originalEvent.abortKeyBinding?()
#taken from https://github.com/yuki-takei/atom-using-electron-chrome-42/tree/edd8eec11d605ee77459232a010c1ac8a3a1ec42
for k, v of originalEvent when k not in syntheticEvent
syntheticEvent[k] = v
After adding this target: value: currentTarget, everything worked fine, as far as I know.
I get the same notification linking to here, though I think the underlying cause might be different. This happens whenever I switch from a buffer with unsaved changes to another buffer. I used break on uncaught exception to get the stacktrace:
@despairblue your issue sounds like a duplicate of atom/status-bar#146 which has been fixed for a long time. Consider updating Atom to the latest version.
@Ben3eeE my comment from April probably was the error you linked to. Now I'm also getting a stack trace that is similar to the one the OP has:
TypeError: Cannot read property 'nodeName' of undefined
at CommandLogger.module.exports.CommandLogger.logCommand (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/notifications/lib/command-logger.js:81:38)
at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/notifications/lib/command-logger.js:33:24
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:240:20)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
at enterNormalMode (/Users/despairblue/Dropbox/dotfiles/Atom/.atom/init.coffee:60:17)
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1154:27)
at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1124:19)
at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:871:26)
at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:738:18)
at Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:3:59)
at Object.autosavePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:58:21)
at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:23:26
at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:152:25)
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:288:22)
at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:437:21)
at /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:545:18
I also tried to fiddle with the whitespace package. It does not seem to be part of this issue here, the error is thrown no matter what configs I choose or even if I disable it.
Also it it does not happen if I simply click another window to trigger the autosave. So I believe it's connected to save being run while the buffer is hidden.
Error
at eval (<anonymous>:1:2)
at Pane.module.exports.Pane.handleSaveError (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:1030:9)
at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:746:25)
at Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:3:59)
at Object.autosavePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:58:21)
at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:23:26
at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:152:25)
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:288:22)
at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:437:21)
at /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:545:18
# Enter normal mode on saveenterNormalMode= () -># when execution ends up here, there is no active TextEditor anymore...editorElement=atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editorElement, 'vim-mode:activate-normal-mode')
atom.workspace.observeTextEditors (editor) ->editor.getBuffer().onDidSave enterNormalMode
fixed it by replacing it with
# Enter normal mode on saveenterNormalMode= (editor) -> () ->editorElement=atom.views.getView(editor)
atom.commands.dispatch(editorElement, 'vim-mode:activate-normal-mode')
atom.workspace.observeTextEditors (editor) ->editor.getBuffer().onDidSave (enterNormalMode editor)
@Ben3eeE thank you and sorry for taking you time :)
Going to close this out since it looks like it was solved by upgrading Electron version. If anyone is still having this problem then please open a new issue.
Activity
ricardopieper commentedon Jul 19, 2015
I'm having the same issue on Atom 1.0.2 - edd8ecc (built by @yuki-takei that solve #6306)
When I try to put it in fullscreen or saving a file or when I click on the encoding setting on the status bar, i get the same exception.
I have haskell-language, haskell-ide, haskell-ghc-mod and some themes.
The saving action doesn't throw any exceptions if I try to save any file, except when it's a Haskell (.hs) source.
ricardopieper commentedon Jul 19, 2015
I got some more information. I don't know the atom infrastructure, but doesn't seem like a bug in this package. Seems like Atom has a problem.
In my case, I had the @yuki-takei's version which solves atom/atom#6306, then I tried to do that by myself, inspiring (copying) the code from Yuki.
Then I forked the main atom repo and applied the same code that Yuki did. However, the problem continued. I suppose it happens because Yuki and me are using a newer version of Electron (instead of the old atom shell), in my case, 0.29.3, and Chrome 43 doesn't know how to handle
Object.create eventwheretypeof eventisCustomEvent. Yuki tried to copy the properties from one object to another, but it didn't solve it completely.This description looks like a soap opera, but still.
An 'event' object was still required, and the notifications package wasn't receiving it.
What I did to solve was to explicitly pass another object on command-registry.coffee, in the function
@handleCommandEvent, where the obejctsyntheticEventis constructed, so the object looks like this:After adding this
target: value: currentTarget, everything worked fine, as far as I know.winstliu commentedon Feb 11, 2016
@ricardopieper Can you still reproduce this on Atom 1.5.1?
despairblue commentedon Apr 6, 2016
I get the same notification linking to here, though I think the underlying cause might be different. This happens whenever I switch from a buffer with unsaved changes to another buffer. I used
break on uncaught exceptionto get the stacktrace:Command History
Versions
This report was created in and posted from the Atom editor using the package
bug-reportv0.7.1.despairblue commentedon Nov 30, 2016
This happens when a buffer is saved without having the focus. How to reproduce:
Cmd+,w/o saving itBen3eeE commentedon Nov 30, 2016
@despairblue your issue sounds like a duplicate of atom/status-bar#146 which has been fixed for a long time. Consider updating Atom to the latest version.
despairblue commentedon Nov 30, 2016
@Ben3eeE I believe I'm uptodate:
despairblue commentedon Nov 30, 2016
@Ben3eeE my comment from April probably was the error you linked to. Now I'm also getting a stack trace that is similar to the one the OP has:
I also tried to fiddle with the whitespace package. It does not seem to be part of this issue here, the error is thrown no matter what configs I choose or even if I disable it.
Also it it does not happen if I simply click another window to trigger the autosave. So I believe it's connected to save being run while the buffer is hidden.
despairblue commentedon Nov 30, 2016
The stack from where the Error is thrown:
Ben3eeE commentedon Nov 30, 2016
@despairblue can you try in safe mode
atom --safeand see if it still happens?despairblue commentedon Nov 30, 2016
Nevermind me, I had this in my
init.coffee:fixed it by replacing it with
@Ben3eeE thank you and sorry for taking you time :)
Ben3eeE commentedon Nov 30, 2016
Going to close this out since it looks like it was solved by upgrading Electron version. If anyone is still having this problem then please open a new issue.