sydro / atom-ansible-vault

Atom package to create and modify ansible-vault file
MIT License
32 stars 10 forks source link

Uncaught TypeError: Cannot read property 'focus' of null #13

Closed yvlasenko closed 7 years ago

yvlasenko commented 7 years ago

[Enter steps to reproduce:]

  1. set up atom-ansible-vault
  2. open encrypted file

Atom: 1.15.0 x64 Electron: 1.3.13 OS: Ubuntu 16.04.2 Thrown From: ansible-vault package 0.5.1

Stack Trace

Uncaught TypeError: Cannot read property 'focus' of null

At /home/yurii/.atom/packages/ansible-vault/lib/ansible-vault-utils.js:52

TypeError: Cannot read property 'focus' of null
    at AnsibleVaultUtils.inputboxHandler (/packages/ansible-vault/lib/ansible-vault-utils.js:52:40)
    at /packages/ansible-vault/lib/ansible-vault-utils.js:128:24
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at /app.asar/node_modules/text-buffer/lib/text-buffer.js:1371:25

Commands

     -2:00.3.0 intentions:highlight (input.hidden-input)
     -2:00.2.0 core:close (input.hidden-input)
     -1:59.4.0 fuzzy-finder:toggle-file-finder (div.package-detail.panels-item)
     -1:58.1.0 core:confirm (input.hidden-input)
     -1:51.7.0 intentions:highlight (input.hidden-input)
     -1:51.5.0 pane:show-next-recently-used-item (input.hidden-input)
     -1:51.4.0 pane:move-active-item-to-top-of-stack (div.package-detail.panels-item)
     -0:35.6.0 pane:show-next-recently-used-item (input#ansible-vault.vault_password_file_flag.input-checkbox)
     -0:35.5.0 pane:move-active-item-to-top-of-stack (input.hidden-input)
     -0:35.2.0 intentions:highlight (input.hidden-input)
     -0:35 command-palette:toggle (input.hidden-input)
  2x -0:31.4.0 core:backspace (input.hidden-input)
     -0:25.4.0 core:select-all (input.hidden-input)
     -0:23.9.0 core:backspace (input.hidden-input)
     -0:22.4.0 editor:consolidate-selections (input.hidden-input)
     -0:22.4.0 core:cancel (input.hidden-input)

Non-Core Packages

ansible-vault 0.5.1 
busy-signal 1.3.0 
highlight-selected 0.13.1 
intentions 1.1.2 
language-ansible 0.2.1 
linter 2.1.2 
linter-ansible-linting 1.2.2 
linter-ansible-syntax 1.1.3 
linter-js-yaml 1.2.7 
linter-pycodestyle 2.0.2 
linter-shellcheck 1.4.4 
linter-ui-default 1.2.2 
merge-conflicts 1.4.4 
minimap 4.26.8 
monokai 0.22.0 
project-manager 3.3.4 
sydro commented 7 years ago

I need more information about steps to reproduce. I have same os and atom version, but i don't have the bug.

yvlasenko commented 7 years ago

Don't really know what to add, just installed package and tried to use it. It looks to me like there should've been a pop up asking for a password but there was no one. Or I might misconfigured something but I didn't see any password prompt.

sydro commented 7 years ago

I released new version of package. With Atom 1.18 and 1.17 the bug there isn't. Do you still have it?

andreabolandrina commented 7 years ago

Just installed the package and I'm getting the same.

Steps to reproduce

  1. install ansible-vault in Atom
  2. set the correct ansible-vault path (/usr/bin/ansible-vault instead of the default one)
  3. click on an ansible vault file called projectVault.yml

and this error below appear:

Was I supposed to get a pop-up?

Atom: 1.20.1 x64 Electron: 1.6.11 OS: linux 4.9.52-1-lts Thrown From: ansible-vault package 0.6.7

Stack Trace

Uncaught TypeError: Cannot read property 'focus' of null

At /home/andrea/.atom/packages/ansible-vault/lib/ansible-vault-utils.js:56

TypeError: Cannot read property 'focus' of null
    at AnsibleVaultUtils.inputboxHandler (/packages/ansible-vault/lib/ansible-vault-utils.js:56:40)
    at /packages/ansible-vault/lib/ansible-vault-utils.js:169:24
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:141:28)
    at /usr/lib/atom/src/text-editor.js:634:32
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:141:28)
    at DisplayLayer.reset (/usr/lib/atom/node_modules/text-buffer/lib/display-layer.js:82:20)
    at TextEditor.module.exports.TextEditor.update (/usr/lib/atom/src/text-editor.js:530:25)
    at TextEditor.module.exports.TextEditor.setEditorWidthInChars (/usr/lib/atom/src/text-editor.js:895:19)
    at TextEditorComponent.updateModelSoftWrapColumn (/usr/lib/atom/src/text-editor-component.js:2124:24)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (/usr/lib/atom/src/text-editor-component.js:358:10)
    at TextEditorComponent.updateSync (/usr/lib/atom/src/text-editor-component.js:265:10)
    at TextEditorComponent.didShow (/usr/lib/atom/src/text-editor-component.js:1458:12)
    at TextEditorComponent.didAttach (/usr/lib/atom/src/text-editor-component.js:1425:14)
    at HTMLElement.attachedCallback (/usr/lib/atom/src/text-editor-element.js:41:25)
    at HTMLElement.PaneElement.activeItemChanged (/usr/lib/atom/src/pane-element.js:144:24)
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:141:28)
    at Pane.module.exports.Pane.setActiveItem (/usr/lib/atom/src/pane.js:335:22)
    at Pane.module.exports.Pane.activateItemAtIndex (/usr/lib/atom/src/pane.js:473:19)
    at Pane.module.exports.Pane.activatePreviousItem (/usr/lib/atom/src/pane.js:438:21)
    at Pane.module.exports.Pane.removeItem (/usr/lib/atom/src/pane.js:628:16)
    at Pane.module.exports.Pane.destroyItem (/usr/lib/atom/src/pane.js:704:16)
    at Pane.module.exports.Pane.addItem (/usr/lib/atom/src/pane.js:555:14)
    at Pane.module.exports.Pane.activateItem (/usr/lib/atom/src/pane.js:487:14)
    at Workspace.<anonymous> (/build/atom/src/atom-1.20.1/out/app/src/workspace.js:1024:12)
    at Generator.next (<anonymous>)
    at step (/build/atom/src/atom-1.20.1/out/app/src/workspace.js:11:273)

Commands

     -7:26.2.0 settings-view:open (input.hidden-input)
     -7:21.1.0 core:confirm (input.hidden-input)
  2x -5:53 core:paste (input.hidden-input)
     -3:25.7.0 tree-view:unfocus (div.tool-panel.tree-view)
     -3:24.7.0 editor:consolidate-selections (input.hidden-input)
     -3:24.7.0 core:cancel (input.hidden-input)
  2x -3:17.9.0 ansible-vault:toggle (div.tool-panel.tree-view)

Non-Core Packages

ansible-vault 0.6.7 
atom-beautify 0.30.5 
atom-ide-ui 0.4.0 
atom-jinja2 0.6.0 
blame 0.12.0 
column-select 0.2.0 
custom-invisibles 0.1.2 
file-watcher 1.2.6 
git-plus 7.9.3 
git-time-machine 1.5.9 
hey-pane 1.0.0 
hyperclick 0.0.0 
keybinding-cheatsheet 0.1.1 
language-ini 1.19.0 
language-terraform 0.8.1 
minimap 4.29.7 
platformio-ide-terminal 2.7.0 
project-plus 1.0.0 
Sublime-Style-Column-Selection 1.7.4 
andreabolandrina commented 7 years ago

I wonder whether it us related to the DE we use on Linux. I mean, if there was a popup to use, it's failing to do so, so it might be related.

I'll add that just in case, I use i3-wm.

Regards, Andrea

sydro commented 7 years ago

Hi, DE isn't the problem. I verify your steps and probably i found the problem. After you changed the absolute path ansible-vault binary, you must disable and enable the package to re-enable the functions. Can you verify this? If it is this problem, then i fix it.

andreabolandrina commented 7 years ago

Bingo! :-)

I've uninstalled the package first, then reinstalled (the ansible-vault path was already correct though), and now it simply works.

Thanks for the quick response.

Regards, Andrea

sydro commented 7 years ago

Thanks you! now I can fix it! :+1: