Uncaught TypeError: Cannot read property 'scopeDescriptorForBufferPosition' of undefined
[Enter steps to reproduce:]
- Editing jsx file
- Pressed return, error occurred. Still able to enter other characters, just not line feed Doesn't occur in js file, just jsx
Atom: 1.22.0-beta1 x64 Electron: 1.6.15 OS: Mac OS X 10.12.6 Thrown From: react package 0.16.2
Stack Trace
Uncaught TypeError: Cannot read property 'scopeDescriptorForBufferPosition' of undefined
At /Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:959
TypeError: Cannot read property 'scopeDescriptorForBufferPosition' of undefined
at TokenizedBuffer.editor.languageMode.suggestedIndentForBufferRow (/packages/react/lib/atom-react.coffee:78:32)
at TextEditor.module.exports.TextEditor.suggestedIndentForBufferRow (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:3732:41)
at TextEditor.module.exports.TextEditor.autoIndentBufferRow (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:3737:32)
at Selection.module.exports.Selection.insertText (/Applications/Atom Beta.app/Contents/Resources/app/src/selection.js:494:27)
at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1215:35
at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1254:34
at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1687:32)
at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1248:30
at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2635:24)
at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2597:41)
at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1246:25)
at TextEditor.module.exports.TextEditor.insertText (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1212:25)
at TextEditor.object.(anonymous function) [as insertText] (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
at TextEditor.module.exports.TextEditor.insertNewline (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1227:25)
at TextEditor.object.(anonymous function) [as insertNewline] (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
at TextEditor.editor:newline (/Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:617:27)
at /Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:677:40
at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1687:32)
at HTMLElement.newCommandListeners.(anonymous function) (/Applications/Atom Beta.app/Contents/Resources/app/src/register-default-commands.js:676:28)
at CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:381:36)
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:3:65)
Commands
-0:17.9.0 editor:newline (input.hidden-input)
Non-Core Packages
atom-ide-ui 0.5.1
atom-indentation-eslintrc 0.1.1
busy-signal 1.4.3
eslint-fixer 1.3.0
ide-json 0.1.0
ide-php 0.6.9
ide-typescript 0.6.2
intentions 1.1.5
linter 2.2.0
linter-eslint 8.4.0
linter-ui-default 1.6.10
react 0.16.2
Issue seems to be isolated - other jsx files fine and this file was ok after closing and re-opening it
I got the same warning here while using it for react practice how to fix this issue? any solutions?
It disappeared after I rebooted - Atom seemed to be getting itself in a mess.
I'm still getting the same issue after closing all files in atom then re-booting. any one else still having this issue after rebooting?
I'm experiencing the issue as well (using Atom 1.22.0).
Same issue here when editing *.js file Atom v1.22.0, react package v0.16.3. Looks like a update to Atom was released this morning (on Github it was v1.22.0 was released 5 days ago) which is causing this. Temporary fix,on windows you can rollback to Atom 1.21.x by navigating to C:\Users<Username>\AppData\Local\Atom\ and removing the latest update. Disabling the package will also work. I have not tried building the binary from source since v1.23.0 is available on github but this might fix the issue to?
UPDATE: After rolling back to 1.21.x, I downloaded the latest installer from the Atom website 1.22.0 and this resolved the issue for v0.16.3. Weird. Regardless, atom-react was updated to v0.17.0 to fix the issue.
any workaround?
Thanks cme0848, it worked :)
Any solution for Mac?
This is still broken, not sure why the issue is closed.
I had this issue on Mac. Quitting atom entirely and reopening did not solve, however closing the individual file affected and reopening though cmd+p sorted it!
@georgegillams It's a temporary hack. I did what you suggested but after some amount of time I'm facing the same problem again.
Same issue here. No way to get rid of it.
I worked around this by switch OFF atom-react package > JavaScript (JSX) Grammer > "Auto Indent"
and don't use tab
Brilliant! This works for me and issue solved!! Thank you very much!
On 9 Nov 2017, at 7:32 pm, Eric Fong [email protected] wrote:
I worked around this by switch OFF atom-react package > JavaScript (JSX) Grammer > "Auto Indent"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/orktes/atom-react/issues/245#issuecomment-343082814, or mute the thread https://github.com/notifications/unsubscribe-auth/AIMxDR_c_icKjYDxeThivCN8mv-pGi8Cks5s0riGgaJpZM4P_LNe.
Working for me. Thanks a lot!!
On Nov 9, 2017 2:32 AM, "Eric Fong" [email protected] wrote:
I worked around this by switch OFF atom-react package > JavaScript (JSX) Grammer > "Auto Indent"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/orktes/atom-react/issues/245#issuecomment-343082814, or mute the thread https://github.com/notifications/unsubscribe-auth/AXfGTtv-xs7nZFNlgv6TaROuoKLCQc_cks5s0riGgaJpZM4P_LNe .
updating the react JSX package did the trick for me
Yes, v0.17.0 was just released. This resolves the issue. Hooray!
thanks @ericfong that solution worked for me!
Hi @kahlilashanti , you better upgrade to v0.17.0.
Which solve this problem (confirmed).
And we can switch ON "Auto Indent" and use tab key again