Constant Cannot call method 'getBufferPosition' errors


#1

Im having a lot of Uncaught TypeError: Cannot call method 'getBufferPosition' of undefined errors when I close files.

Have anyone found out what is causing it?


#2

That was a bug that was supposedly fixed in a previous version. What version of Atom are you running?


#3

Yes, i’ve noticed it stopped for a while, but it’s back and in a spectacular way. Happens very, very frequently.
Im running the latest version at the moment (0.104.0)


#4

Ok, if you can give us a stack trace that would help. Also, can you reproduce it with atom --safe?


#6

Can you point me to any tips on how to extract the trace for those errors?


#7

Sure … when the console comes up, you’ll probably get a red line that looks something like the Error lines here with the triangle next to them:

Just click the triangle to expand the red line into a bunch of red lines (though it should already be expanded) and copy all the red text and paste it here in the board.


#8

Oh, I thought you’re mentioning something different. Thanks for the tip.

In safe mode the error doesn’t happen, and the trace include the following information:

Uncaught TypeError: Cannot call method 'getBufferPosition' of undefined /Applications/Atom.app/Contents/Resources/app/src/editor.js:1369
module.exports.Editor.getCursorBufferPosition /Applications/Atom.app/Contents/Resources/app/src/editor.js:1369
StatusBarView.render statusbar-view.coffee:75
LinterView.displayStatusBar linter-view.coffee:172
LinterView.display linter-view.coffee:153
LinterView.processMessage linter-view.coffee:145
(anonymous function) linter-view.coffee:1
(anonymous function) linter-view.coffee:133
Linter.processMessage linter.coffee:127
(anonymous function) linter.coffee:106
(anonymous function) /Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:88
EventEmitter.emit events.js:123
(anonymous function)

Im guessing this means is something related to the Linter package.


#9

Probably … can you try reproducing the error after exiting out of Atom and relaunching it using atom --safe? This launches Atom with only the built-in packages and can help determine if an error like this is due to Atom or due to a third-party package.


#10

Yes, I did confirm that in safe mode the error doesn’t happen.
I’ve also disabled the Linter package and again, the errors stop. Going to report this to the package owner. Thanks for all the help @leedohm


#11

You’re welcome. I’m glad I could help :grinning: