guiguan / file-header

FileHeader for Atom
https://atom.io/packages/file-header
Other
31 stars 21 forks source link

Uncaught (in promise) TypeError: buffer.getHistory is not a function #49

Closed calvin-green closed 7 years ago

calvin-green commented 7 years ago

I can't seem to save any files when the extensions is enabled. This error pops up in the dev console: Uncaught (in promise) TypeError: buffer.getHistory is not a function at Object.update (/home/calvin/.atom/packages/file-header/lib/file-header.coffee:299:22) at /home/calvin/.atom/packages/file-header/lib/file-header.coffee:164:10 at Function.module.exports.Emitter.simpleDispatch (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20) at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34) at TextBuffer.module.exports.TextBuffer.saveTo (/opt/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1199:26) at TextBuffer.module.exports.TextBuffer.save (/opt/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1165:25) at TextEditor.module.exports.TextEditor.save (/opt/atom/resources/app/src/text-editor.js:1004:32) at /opt/atom/resources/app/src/pane.js:816:31 at promisify (/opt/atom/resources/app/src/pane.js:1171:36) at Pane.module.exports.Pane.saveItem (/opt/atom/resources/app/src/pane.js:815:24) at Pane.saveItem (/opt/atom/resources/app/src/pane.js:5:65) at Pane.module.exports.Pane.saveActiveItem (/opt/atom/resources/app/src/pane.js:799:25) at Workspace.saveActivePaneItem (/opt/atom/resources/app/src/workspace.js:1561:53) at HTMLElement.core:save (/opt/atom/resources/app/src/register-default-commands.js:236:38) at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/atom/resources/app/src/command-registry.js:265:35) at /opt/atom/resources/app/src/command-registry.js:3:65 at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22) at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28) at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/opt/atom/resources/app/src/window-event-handler.js:100:42) at HTMLDocument.<anonymous> (/opt/atom/resources/app/src/window-event-handler.js:3:65)

guiguan commented 7 years ago

@calvin-green just published a fix for this. Can you give it a try?

calvin-green commented 7 years ago

Hi @guiguan

Thanks for the speedy response. The issue persists after I updated the package to your latest commit. I've found that disabling Auto Update fixes the issue. Stack trace: Uncaught (in promise) TypeError: buffer.getHistory is not a function at Object.update (/home/calvin/.atom/packages/file-header/lib/file-header.coffee:299:22) at /home/calvin/.atom/packages/file-header/lib/file-header.coffee:164:10 at Function.module.exports.Emitter.simpleDispatch (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20) at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34) at TextBuffer.module.exports.TextBuffer.saveTo (/opt/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1199:26) at TextBuffer.module.exports.TextBuffer.save (/opt/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1165:25) at TextEditor.module.exports.TextEditor.save (/opt/atom/resources/app/src/text-editor.js:1004:32) at /opt/atom/resources/app/src/pane.js:816:31 at promisify (/opt/atom/resources/app/src/pane.js:1171:36) at Pane.module.exports.Pane.saveItem (/opt/atom/resources/app/src/pane.js:815:24) at Pane.saveItem (/opt/atom/resources/app/src/pane.js:5:65) at Pane.module.exports.Pane.saveActiveItem (/opt/atom/resources/app/src/pane.js:799:25) at Workspace.saveActivePaneItem (/opt/atom/resources/app/src/workspace.js:1561:53) at HTMLElement.core:save (/opt/atom/resources/app/src/register-default-commands.js:236:38) at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/atom/resources/app/src/command-registry.js:265:35) at /opt/atom/resources/app/src/command-registry.js:3:65 at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22) at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28) at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/opt/atom/resources/app/src/window-event-handler.js:100:42) at HTMLDocument.<anonymous> (/opt/atom/resources/app/src/window-event-handler.js:3:65)

guiguan commented 7 years ago

Sorry, made a mistake. Can you try it now?

calvin-green commented 7 years ago

Hi @guiguan

It looks like the issue has been resolved. Thanks for the speedy response :smile: