linter-js-standard: Uncaught TypeError: Cannot read property 'style' of undefined

[Enter steps to reproduce:]

  1. …
  2. …

Atom: 1.14.4 x64 Electron: 1.4.15 OS: “Arch Linux” Thrown From: linter-js-standard package 3.9.0

Stack Trace

Uncaught TypeError: Cannot read property ‘style’ of undefined

At /home/edar/.atom/packages/linter-js-standard/lib/init.js:111

TypeError: Cannot read property 'style' of undefined
    at Object.__cacheTextEditor (/packages/linter-js-standard/lib/init.js:111:18)
    at storeSettings (/packages/linter-js-standard/lib/init.js:79:14)
    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:129:28)
    at /usr/lib/atom/src/pane-container.js:348:27
    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:129:28)
    at Pane.module.exports.Pane.setActiveItem (/usr/lib/atom/src/pane.js:300:22)
    at Pane.module.exports.Pane.activateItemAtIndex (/usr/lib/atom/src/pane.js:435:19)
    at Pane.module.exports.Pane.activatePreviousItem (/usr/lib/atom/src/pane.js:400:21)
    at Pane.module.exports.Pane.removeItem (/usr/lib/atom/src/pane.js:585:16)
    at Pane.module.exports.Pane.destroyItem (/usr/lib/atom/src/pane.js:658:16)
    at TabBarView.module.exports.TabBarView.closeTab (/usr/lib/atom/node_modules/tabs/lib/tab-bar-view.js:333:26)
    at HTMLDivElement.TabView.didClickCloseIcon (/usr/lib/atom/node_modules/tabs/lib/tab-bar-view.js:222:19)

Commands

     -9:20.7.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-fusion-syntax.theme-one-dark-ui)
     -9:14.1.0 editor:join-lines (input.hidden-input)
     -9:07.8.0 settings-view:open (input.hidden-input)
  2x -8:59.9.0 core:confirm (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.5 
angular-2 0.2.6 
angular-2-typeScript-snippets 0.6.3 
angular-bootstrap 1.0.1 
angular-restful-snippets 0.14.0 
angular2-snippets 0.3.0 
angularjs 0.4.0 
angularjs-snippets 0.10.18 
atom-beautify 0.29.17 
atom-bootstrap3 1.2.12 
atom-bootstrap4 1.4.0 
atom-dark-fusion-syntax 2.0.3 
express-complete 0.2.0 
autocomplete-angular-material 0.4.0 
autocomplete-modules 1.6.7 
cdn-libs 0.1.2 
color-picker 2.2.5 
css-snippets 1.1.0 
emmet 2.4.3 
expressjs 1.2.0 
file-icons 2.0.16 
flexbox-snippets 0.3.0 
git-plus 7.3.3 
git-plus-plus 1.1.0 
hyperclick 0.0.40 
js-hyperclick 1.10.1 
js-hyperx 1.1.0 
js-refactor 0.7.5 
language-babel 2.55.6 
language-graphql 0.8.0 
language-html-angular 1.0.16 
language-mongodb 0.3.1 
less-autocompile 1.0.0 
linter 1.11.23 
linter-eslint 8.1.2 
linter-js-standard 3.9.0 
linter-less 2.6.0 
linter-sass-lint 1.7.4 
linter-stylelint 3.9.0 
minimap 4.26.8 
minimap-autohide 0.10.1 
minimap-highlight-selected 4.5.0 
path-hyperclick 0.3.0 
pigments 0.39.0 
platformio-ide-terminal 2.3.1 
refactor 0.11.3 
rest-client 1.3.1 
smart-daemon-control 0.8.7 
template-generator 0.15.0 
todo-show 1.11.0 

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 3
  • Comments: 24 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I have just had the same issue with Atom v1.14.4 on macOS. To reproduce:

  1. touch foo.js
  2. atom foo.js
  3. Type something into foo.js but do not save the file
  4. Open another tab, for example Settings
  5. rm foo.js
  6. Switch back to foo.js in Atom

This mostly happens to me when I switch between branches. I’ll leave files open (in background tabs) that do not exist on another branch, and if I switch back to one of those tabs (manually or just when closing other tabs and they are supposed to come to the foreground) I run into this issue.

This will be fixed in an upcoming patch version.

come on, when will this be fixed??

I can reproduce the error by deleting a file that Atom currently has open in an inactive tab, then switching to the tab.

To eliminate as much unpredictability as possible, here is a command line that will generate the error 100% of the time.

touch foo.js && touch bar.js && atom foo.js && sleep 10 && rm foo.js && atom bar.js

Now just click back on the tab for foo.js and you’ll see the error. At least I do, on Mac OS 10.12.4.

Released in v3.9.2 🎉

I’ll install from your fork if it doesn’t get merged or fixed in some other way.