atom-ternjs icon indicating copy to clipboard operation
atom-ternjs copied to clipboard

Uncaught TypeError: Cannot set property 'isDirty' of undefined

Open netsi1964 opened this issue 8 years ago • 30 comments

This error popped up by it self as I had a .js file opened.

Atom: 1.14.4 ia32 Electron: 1.3.13 OS: Microsoft Windows 7 Professional Thrown From: atom-ternjs package 0.18.1

Stack Trace

Uncaught TypeError: Cannot set property 'isDirty' of undefined

At C:\Users\SHO\.atom\packages\atom-ternjs\lib\atom-ternjs-manager.js:259

TypeError: Cannot set property 'isDirty' of undefined
    at /packages/atom-ternjs/lib/atom-ternjs-manager.js:259:23
    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 TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (/app.asar/node_modules/text-buffer/lib/text-buffer.js:680:20)
    at TextBuffer.module.exports.TextBuffer.applyChange (/app.asar/node_modules/text-buffer/lib/text-buffer.js:664:12)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/app.asar/node_modules/text-buffer/lib/text-buffer.js:868:16)
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:822:14)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1551:26)
    at /app.asar/src/text-editor.js:1128:24
    at TextEditor.module.exports.TextEditor.mergeSelections (/app.asar/src/text-editor.js:2528:18)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/app.asar/src/text-editor.js:2490:35)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/app.asar/src/text-editor.js:1126:19)
    at TextEditor.module.exports.TextEditor.insertText (/app.asar/src/text-editor.js:1092:19)
    at /packages/language-babel/lib/did-insert-text.coffee:77:18)
    at /app.asar/node_modules/underscore-plus/lib/underscore-plus.js:77:27)
    at TextEditorComponent.module.exports.TextEditorComponent.onTextInput (/app.asar/src/text-editor-component.js:478:26)
    at /app.asar/src/text-editor-component.js:3:59)

Commands

     -1:12.4.0 command-palette:toggle (input.hidden-input)
     -1:09.8.0 core:confirm (input.hidden-input)
     -1:09.8.0 linter-eslint:fix-file (input.hidden-input)
     -1:02.3.0 core:save (input.hidden-input)
  3x -0:52.5.0 command-palette:toggle (input.hidden-input)
     -0:48.4.0 core:confirm (input.hidden-input)
     -0:48.4.0 linter-eslint:fix-file (input.hidden-input)
  2x -0:44.8.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 
atom-css-unit-converter 1.1.1 
atom-handlebars 1.3.0 
atom-html-preview undefined 
atom-jsx-transform 0.2.0 
atom-runner 2.7.1 
atom-ternjs 0.18.1 
atom-xsltransform 0.8.0 
autocomplete-modules 1.6.7 
autocomplete-paths 1.0.5 
browser-refresh-on-save 0.0.6 
clang-format 1.28.0 
color-picker 2.2.5 
docblockr 0.9.1 
emmet 2.4.3 
es6-javascript 1.0.0 
file-types 0.5.5 
gist-it 0.9.2 
gulp-control 0.5.0 
html-entities 0.4.0 
javascript-snippets 1.2.1 
js-refactor 0.7.5 
jsdoc-generator 0.2.3 
jshint 1.8.6 
language-babel 2.55.6 
language-javascript-jsx 0.3.7 
language-postcss 1.3.0 
language-svg 0.9.2 
less-postcss-autocompile 1.2.3 
linter 1.11.23 
linter-eslint 8.1.2 
linter-flow 5.5.0 
linter-jshint 3.0.2 
linter-jsonlint 1.3.0 
linter-jsxhint 0.1.2 
linter-xmllint 1.4.0 
markdown-pdf 1.5.0 
markdown-toc 0.4.2 
markdown-writer 2.6.4 
merge-conflicts 1.4.4 
minimap 4.26.8 
mocha-test-runner 0.5.1 
nodejs-snippets 2.0.2 
permanent-delete 0.1.5 
pigments 0.39.0 
platformio-ide-terminal 2.3.1 
postcss-sorting 2.9.0 
preview 0.17.0 
preview-plus 1.2.7 
react 0.16.2 
react-snippets 0.7.1 
refactor 0.11.3 
regex-railroad-diagram 0.16.0 
rest-client 1.3.1 
script 3.14.1 
select-rectangle 1.0.2 
split-diff 1.2.0 
svg-preview 0.11.0 
svgo 2.6.0 
sync-settings 0.8.1 
terminal-plus 0.14.5 
todo-show 1.11.0 
toggle-quotes 1.0.0 

netsi1964 avatar Mar 01 '17 07:03 netsi1964

Is this planned to be fixed? It's unusable as it is, I had to remove it.

BrunoBernardino avatar Mar 03 '17 10:03 BrunoBernardino

Sure it is planned to be fixed as soon as possible. Downgrade to the latest version if it is unusable. I'm not able to reproduce the issue on macOS so i will try it on Windows later. Any help is welcome.

tststs avatar Mar 03 '17 10:03 tststs

The error occurs here: https://github.com/tststs/atom-ternjs/blob/master/lib/atom-ternjs-manager.js#L257

You may debug it and check why no editor is returned from the method call getEditor. This would help a lot.

Since i'm pretty unsure what is happening here are some questions:

  • was the file located inside a project?
  • did the file already exist before the error popped up or was it added to the workspace and then saved as a JavaScript file?
  • does the error popped up after a pane was closed?
  • does this happen with each JavaScript file?
  • please always post your .tern-project config (if any)

tststs avatar Mar 03 '17 16:03 tststs

same

viztor avatar Mar 04 '17 10:03 viztor

Well, I have been able to go through coding without the extension, so it's not a top priority for me to fix it right now. I've got a reminder to look into it, potentially this weekend.

I can say it was happening for any JS file, and I couldn't change anything in the file while the extension was enabled.

BrunoBernardino avatar Mar 07 '17 10:03 BrunoBernardino

Well, I'm no longer having this issue with 0.18.2 (which is expected because of https://github.com/tststs/atom-ternjs/commit/2653f6e7b3347c3e6184a4fe3780196d43426852) but also atom-ternjs appears to be working fine.

I think you can close this.

BrunoBernardino avatar Mar 11 '17 09:03 BrunoBernardino

Well, it just happened again (same .isDirty error, different line/file) for just one file (I could edit other files). When I reloaded atom, it went away. 😕

BrunoBernardino avatar Mar 14 '17 12:03 BrunoBernardino

I just hit the same issue. Restarting atom resolved the issue

roderik avatar Mar 15 '17 08:03 roderik

I have the same issue, if vim-mode is enabled.

yacut avatar Mar 17 '17 07:03 yacut

I have the issue too.

jeremy447 avatar Mar 17 '17 16:03 jeremy447

I faced this issue now.Restarting the atom solved my problem as @roderik mentioned earlier. Hope you guyz to fix this.

bcavus avatar Mar 19 '17 16:03 bcavus

Same here. Restaring helps.

drom avatar Mar 27 '17 23:03 drom

@tststs FYI: I've got the same error on Mac OSX (restarting helps as other says)

yvele avatar Mar 28 '17 06:03 yvele

I've seen just closing the file and reopening it helps as well. Not an ideal workflow and is still happening infrequently enough to not make me disable the extension and get more debug info :)

BrunoBernardino avatar Mar 28 '17 09:03 BrunoBernardino

Same issue, las version of ATOM 1.15.0 on Ubuntu 14.04 LTS.

emilioponce avatar Mar 31 '17 08:03 emilioponce

Restarting fixed it for me

Nate-Adams avatar Apr 02 '17 23:04 Nate-Adams

Hi, I restarted as well, but after some time the error appears again

emilioponce avatar Apr 03 '17 07:04 emilioponce

Same issue, Fedora 25, ATOM 1.13.0. Closed file, have not had issue again, yet...

JFarand avatar Apr 04 '17 07:04 JFarand

  1. now, this issues appears after I update some packages and reload display panel. close the panel and reopen the file, all is okay.

Atom: 1.16.0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.4 Thrown From: atom-ternjs package 0.18.2

Stack Trace

Uncaught TypeError: Cannot set property 'isDirty' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:833

TypeError: Cannot set property 'isDirty' of undefined
    at /packages/atom-ternjs/lib/atom-ternjs-manager.js:262:23
    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 TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (/app.asar/node_modules/text-buffer/lib/text-buffer.js:680:20)
    at TextBuffer.module.exports.TextBuffer.applyChange (/app.asar/node_modules/text-buffer/lib/text-buffer.js:664:12)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/app.asar/node_modules/text-buffer/lib/text-buffer.js:877:16)
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:831:14)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1594:26)
    at /app.asar/src/text-editor.js:1155:24
    at TextEditor.module.exports.TextEditor.mergeSelections (/app.asar/src/text-editor.js:2568:43)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/app.asar/src/text-editor.js:2534:35)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/app.asar/src/text-editor.js:1153:19)
    at TextEditor.module.exports.TextEditor.insertText (/app.asar/src/text-editor.js:1119:19)
    at /packages/language-babel/lib/did-insert-text.coffee:77:18)
    at /app.asar/node_modules/underscore-plus/lib/underscore-plus.js:77:27)
    at TextEditor.module.exports.TextEditor.insertNewline (/app.asar/src/text-editor.js:1134:19)
    at /app.asar/node_modules/underscore-plus/lib/underscore-plus.js:77:27)
    at /app.asar/src/register-default-commands.js:606:21)
    at /app.asar/src/register-default-commands.js:666:34
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:828:18)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1594:26)
    at /app.asar/src/register-default-commands.js:665:22)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

  3x -1:22.5.0 editor:newline (input.hidden-input)

Non-Core Packages

activate-power-mode 1.4.0 
angular2-snippets 0.3.0 
angularjs 0.4.0 
atom-beautify 0.29.22 
atom-bootstrap3 1.2.12 
atom-certificate-view 0.1.0 
atom-ctags 5.0.0 
atom-format-lua 0.1.5 
atom-icons 0.2.2 
atom-material-syntax 1.0.2 
atom-material-ui 1.3.9 
atom-miku 2.2.5 
atom-ternjs 0.18.2 
atom-typescript 11.0.2 
autoclose-html 0.23.0 
autocomplete-erlang 1.1.2 
autocomplete-go 1.3.0 
autocomplete-python 1.8.63 
builder-go 1.0.1 
busy-signal 1.3.0 
convert-to-utf8 0.2.4 
css-snippets 1.1.0 
es6-javascript 1.0.0 
git-plus 7.5.0 
go-config 1.2.4 
go-debug 1.2.0 
go-get 2.1.1 
go-plus 5.4.0 
gofmt 1.2.0 
gometalinter-linter 1.2.2 
gorename 1.1.0 
intentions 1.1.2 
language-babel 2.57.4 
language-cmake 0.3.0 
language-docker 1.1.7 
language-erlang 3.2.0 
language-ini 1.19.0 
language-javascript-jsx 0.3.7 
language-julia 0.11.0 
language-lua 0.9.11 
language-nginx 0.7.2 
language-pgsql 0.2.3 
language-rust 0.4.10 
language-scala 1.1.8 
language-svg 0.9.2 
language-ts 1.0.2 
language-viml 1.1.3 
language-vue 0.21.2 
language-weex 1.2.0 
linter 2.1.4 
linter-csslint 1.3.4 
linter-erlang 0.4.0 
linter-eslint 8.1.6 
linter-gcc 0.7.1 
linter-lua 1.0.4 
linter-rust 0.8.0 
linter-sass-lint 1.7.4 
linter-shellcheck 1.4.4 
linter-tslint 1.1.0 
linter-ui-default 1.2.3 
minimap 4.27.1 
minimap-git-diff 4.3.1 
navigator-go 1.1.3 
platformio-ide-terminal 2.5.0 
pretty-json 1.6.3 
python-isort 0.0.7 
react 0.16.2 
rust-api-docs-helper 0.5.1 
terminal-plus 0.14.5 
tester-go 2.0.2 
todo-show 1.11.0 

mingjunyang avatar Apr 20 '17 01:04 mingjunyang

I had the issue today after updating. Restarting works for me

kayakinwunmi avatar Apr 23 '17 20:04 kayakinwunmi

Same issue after update atom-ternjs, occur when i type the first char in a .js file.

Atom: 1.16.0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.4 Thrown From: atom-ternjs package 0.18.2

Stack Trace

Uncaught TypeError: Cannot set property 'isDirty' of undefined

At /Users/jysperm/.atom/packages/atom-ternjs/lib/atom-ternjs-manager.js:262

TypeError: Cannot set property 'isDirty' of undefined
    at /packages/atom-ternjs/lib/atom-ternjs-manager.js:262:23
    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 TextBuffer.module.exports.TextBuffer.emitDidChangeEvent (/app.asar/node_modules/text-buffer/lib/text-buffer.js:680:20)
    at TextBuffer.module.exports.TextBuffer.applyChange (/app.asar/node_modules/text-buffer/lib/text-buffer.js:664:12)
    at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/app.asar/node_modules/text-buffer/lib/text-buffer.js:877:16)
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:831:14)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1594:26)
    at /app.asar/src/text-editor.js:1155:24
    at TextEditor.module.exports.TextEditor.mergeSelections (/app.asar/src/text-editor.js:2572:18)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/app.asar/src/text-editor.js:2534:35)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/app.asar/src/text-editor.js:1153:19)
    at TextEditor.module.exports.TextEditor.insertText (/app.asar/src/text-editor.js:1119:19)
    at /app.asar/node_modules/underscore-plus/lib/underscore-plus.js:77:27)
    at TextEditorComponent.module.exports.TextEditorComponent.onTextInput (/app.asar/src/text-editor-component.js:478:26)
    at /app.asar/src/text-editor-component.js:3:59)

Commands

     -4:51 application:add-project-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -4:10.3.0 tabs:split-right (li.texteditor.tab.sortable.pending-tab.active.right-clicked)

Non-Core Packages

aesthetic-ui 3.0.1 
api-workbench 0.8.45 
atom-beautify 0.29.23 
atom-ternjs 0.18.2 
atom-typescript 11.0.3 
browser-plus 0.0.87 
busy-signal 1.4.0 
codelf 4.9.0 
expand-region 0.2.7 
file-icons 2.1.3 
git-plus 7.6.0 
go-plus 5.4.0 
highlight-selected 0.13.1 
intentions 1.1.2 
language-ejs 0.4.0 
language-jade 0.7.2 
language-lua 0.9.11 
language-nginx 0.7.2 
language-pug 0.0.21 
linter 2.1.4 
linter-coffeelint 1.2.1 
linter-eslint 8.1.6 
linter-ui-default 1.2.3 
local-history 4.0.1 
project-manager 3.3.4 
random 1.3.0 
react 0.16.2 
remote-sync 4.1.5 
sort-lines 0.14.0 
Sublime-Style-Column-Selection 1.7.4 
vim-mode 0.66.0 
wakatime 6.0.14 

jysperm avatar Apr 25 '17 03:04 jysperm

I get a similar error I try to type first single quote in a newly created file htmllint.js but it works fine if I with lint/html.js

KSXGitHub avatar Apr 27 '17 04:04 KSXGitHub

@tststs Is there any other information we can try to provide so you can push out a fix?

BrunoBernardino avatar Apr 27 '17 09:04 BrunoBernardino

Currently can't press return... Gets an error. On a whim, I restarted Atom, and the errors went away. This only happened after I restarted after a plugin update.

booc0mtaco avatar Apr 28 '17 16:04 booc0mtaco

i still have the same issue

Atom: 1.16.0 x64 OS: Mac OS X 10.12.4 Thrown From: atom-ternjs package 0.18.2

ikzjfr0 avatar Apr 30 '17 22:04 ikzjfr0

Same issue for me with macOS Sierra 10.12.2, but the issue seems to be thrown from vim-mode-plus, although tern is at the top of the stack trace. An issue had been opened at vim-mode-plus previously for this. Are you guys having this issue when vim-mode is disabled as well?

saadq avatar May 01 '17 19:05 saadq

I do not have vim-mode-plus and still get this issue.

BrunoBernardino avatar May 02 '17 06:05 BrunoBernardino

Sorry for the late reply. Busy time and no free time slots for OS. OS does not pay the bills... 😆 Hopefully 0.18.3 fixes the issue. I never could reproduce it, so please report if the issue still occurs.

tststs avatar May 03 '17 19:05 tststs

same (: I can give 1$ for fixing it ahahsas..

erhanyasar avatar May 16 '17 11:05 erhanyasar

Still getting this issue with updated version 1.17.0 (on MacOS 10.12.4)

/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:854 From the atom-ternjs package

oddscenes avatar May 17 '17 00:05 oddscenes