Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined #119

Closed

Description

@little-gems
  1. Load a .txt file that was previously encoded as ANSI.

Atom Version: 0.170.0
System: Microsoft Windows 8.1
Thrown From: bracket-matcher package, v0.67.0

Stack Trace

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

At c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\tokenized-buffer.js:503

TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
  at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\tokenized-buffer.js:503:38)
  at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\tokenized-buffer.js:496:22)
  at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\display-buffer.js:1044:35)
  at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\text-editor.js:2378:33)
  at Cursor.module.exports.Cursor.getScopeDescriptor (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\cursor.js:227:26)
  at TagFinder.module.exports.TagFinder.isCursorOnTag (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\bracket-matcher\lib\tag-finder.js:39:67)
  at TagFinder.module.exports.TagFinder.findMatchingTags (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\bracket-matcher\lib\tag-finder.js:140:16)
  at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\bracket-matcher\lib\bracket-matcher-view.js:128:35)
  at c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\bracket-matcher\lib\bracket-matcher-view.js:40:24
  at Emitter.module.exports.Emitter.emit (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\event-kit\lib\emitter.js:82:11)
  at c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\text-editor.js:207:32
  at Emitter.module.exports.Emitter.emit (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\event-kit\lib\emitter.js:82:11)
  at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\display-buffer.js:320:20)
  at DisplayBuffer.module.exports.DisplayBuffer.updateScreenLines (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\display-buffer.js:1482:21)
  at DisplayBuffer.module.exports.DisplayBuffer.handleTokenizedBufferChange (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\display-buffer.js:1444:12)
  at c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\display-buffer.js:5:61
  at Emitter.module.exports.Emitter.emit (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\event-kit\lib\emitter.js:82:11)
  at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\tokenized-buffer.js:286:22)
  at c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\src\tokenized-buffer.js:247:26
  at c:\Users\David\AppData\Local\atom\app-0.170.0\resources\app\node_modules\roaster\node_modules\underscore\underscore.js:666:47

Commands

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

/cc @atom/core

Activity

  1. aroman commented on Mar 25, 2015

    @aroman

    Just got this error too. Was editing an html file and I tried to save it and this happened.

    Stack trace:

    /Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559
    Hide Stack Trace
    TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
      at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559:38)
      at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:552:22)
      at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1042:35)
      at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2453:33)
      at Cursor.module.exports.Cursor.getScopeDescriptor (/Applications/Atom.app/Contents/Resources/app/src/cursor.js:227:26)
      at TagFinder.module.exports.TagFinder.isCursorOnTag (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:39:67)
      at TagFinder.module.exports.TagFinder.findMatchingTags (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:140:16)
      at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:128:35)
      at /Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:40:24
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:211:32
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:318:20)
      at DisplayBuffer.module.exports.DisplayBuffer.handleBufferMarkersUpdated (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1570:21)
      at /Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:5:61
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:599:20)
      at BufferPatch.module.exports.BufferPatch.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
      at Transaction.module.exports.Transaction.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
      at History.module.exports.History.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:87:24)
      at TextBuffer.module.exports.TextBuffer.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:679:27)
      at TextEditor.module.exports.TextEditor.undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1206:26)
      at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:312:19)
      at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:280:32)
      at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:246:29)
      at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
      at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
      at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
      at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:182:20)
    
  2. kevinsawicki commented on Mar 26, 2015

    @kevinsawicki
    Contributor

    I believe this is a duplicate of #110 and should be fixed if you upgrade to Atom 0.188 or later

  3. aroman commented on Mar 26, 2015

    @aroman

    Actually, I experienced the bug on 0.188. Hmm.

  4. kevinsawicki commented on Mar 26, 2015

    @kevinsawicki
    Contributor

    Actually, I experienced the bug on 0.188. Hmm.

    Ah interesting, can you reliably reproduce it or did it just happen that once?

  5. aroman commented on Mar 26, 2015

    @aroman

    It happened once randomly while editing an html/jinja2 template file. I'll definitely comment back here if it happens again, but it seemed pretty out of the blue. I think it was in the middle of typing? Also, if it helps the investigation I use the vim plugin.

  6. Lenocam commented on May 20, 2015

    @Lenocam

    Having the same issue. When I've closed angle brackets for ul and table. It was happening periodically, maybe a couple times a day. Now it is happening nearly every time I close angled brackets.

    [Enter steps to reproduce below:]

    1. ...
    2. ...

    Atom Version: 0.177.0
    System: linux 3.13.0-45-generic
    Thrown From: bracket-matcher package, v0.71.0

    Stack Trace

    Uncaught TypeError: Cannot read property 'getBufferPosition' of undefined

    At /usr/share/atom/resources/app/src/text-editor.js:1339
    
    TypeError: Cannot read property 'getBufferPosition' of undefined
      at TextEditor.module.exports.TextEditor.getCursorBufferPosition (/usr/share/atom/resources/app/src/text-editor.js:1339:34)
      at BracketMatcher.module.exports.BracketMatcher.insertNewline (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher.js:133:42)
      at TextEditor.<anonymous> (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher.js:3:61)
      at TextEditor.object.(anonymous function) [as insertNewline] (/usr/share/atom/resources/app/node_modules/underscore-plus/lib/underscore-plus.js:76:20)
      at /home/reed/.atom/packages/autoclose-html/lib/autoclose-html.coffee:84:28
    
    

    Commands

         -7:42.4 settings-view:open (atom-workspace.workspace.scrollbars-visible-always.theme-itg-dark-syntax.theme-itg-flat-dark)
    

    Config

    {
      "core": {
        "themes": [
          "itg-flat-dark",
          "itg-dark-syntax"
        ],
        "disabledPackages": [
          "placeholder-text"
        ]
      }
    }

    Installed Packages

    # User
    atom-html-preview, v0.1.6
    autoclose-html, v0.16.0
    itg-dark-syntax, v0.3.0
    itg-flat-dark, v0.1.1
    
    # Dev
    No dev packages

    /cc @atom/core

  7. mnquintana commented on May 20, 2015

    @mnquintana
    Contributor

    @Lenocam You're using an old version – can you try upgrading to the latest version of Atom (0.200.0) and see if you can reproduce this issue?

  8. winstliu commented on May 20, 2015

    @winstliu
    Contributor

    @Lenocam I have a suspicion that it might be the autoclose-html package that's causing this-if you disable that, can you still reproduce your issue?

  9. winstliu commented on Sep 25, 2016

    @winstliu
    Contributor

    No response or further reports, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions