mschuchard / linter-ansible-linting

ansible-lint linter for pulsar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError: this.element.querySelector is not a function

mknights opened this issue · comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.0-beta5 x64
Electron: 1.3.15
OS: "Red Hat
Thrown From: linter-ansible-linting package 1.2.3
User: root

Stack Trace

Uncaught TypeError: this.element.querySelector is not a function

At /home/admin/.atom/packages/linter-ansible-linting/node_modules/atom-package-deps/lib/view.js:41

TypeError: this.element.querySelector is not a function
    at View.advance (/packages/linter-ansible-linting/node_modules/atom-package-deps/lib/view.js:41:36)
    at /packages/linter-ansible-linting/node_modules/atom-package-deps/lib/main.js:53:16
    at stdout (/packages/linter-ansible-linting/node_modules/atom-package-deps/lib/helpers.js:24:11)
    at Socket.<anonymous> (/usr/share/atom-beta/resources/app/src/buffered-process.js:212:1)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20)

Commands

     -4:14.2.0 application:open (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -2:30.5.0 core:confirm (input.hidden-input)

Non-Core Packages

ansible-snippets 0.2.0 
language-ansible 0.2.1 
linter 2.1.4 
linter-ansible-linting 1.2.3 

That was thrown from atom-package-deps, which means it occurred during activation, which means everything will still run fine for you. It is still random and unexplained though, but this is the second time I have that package exhibit undefined behavior.

Nothing about that stack trace makes sense... the only way I can see for that code to error is if you managed to close the notification in the ~0.1 ms before it tried to grab the view. Even if somehow that was the case that code block is in a try/catch block, meaning it shouldn't throw no matter what.

@steelbrain any idea what is going on here?

This would only ever happen if the user had the notifications built-in package disabled

Ah ha, turns out that try/catch is only in the current version. @mschuchard you're a major version behind on atom-package-deps 😛.

I'd recommend setting it to ^4.6.0 as versions below that add ~120 ms to your package's startup time. v4.6.0 drops that to ~30 ms, to take that time entirely out of the activation time of your package you need to push it into an idle callback similar to what is done in AtomLinter/linter-lintr#94 for example.