Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Uncaught TypeError: Cannot read property 'isComment' of undefined #5905

Closed

Description

@TobEnd
  1. Editing an unsaved .xml file

Atom Version: 0.182.0
System: linux 3.18.6-1-ARCH
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property 'isComment' of undefined

At /usr/share/atom/resources/app/src/tokenized-buffer.js:401

TypeError: Cannot read property 'isComment' of undefined
  at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableCodeAtRow (/usr/share/atom/resources/app/src/tokenized-buffer.js:401:71)
  at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableAtRow (/usr/share/atom/resources/app/src/tokenized-buffer.js:396:19)
  at TokenizedBuffer.module.exports.TokenizedBuffer.updateFoldableStatus (/usr/share/atom/resources/app/src/tokenized-buffer.js:384:25)
  at TokenizedBuffer.module.exports.TokenizedBuffer.handleBufferChange (/usr/share/atom/resources/app/src/tokenized-buffer.js:351:20)
  at /usr/share/atom/resources/app/src/tokenized-buffer.js:56:24
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextBuffer.module.exports.TextBuffer.applyPatch (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:594:20)
  at BufferPatch.module.exports.BufferPatch.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/usr/share/atom/resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.abortTransaction (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:165:24)
  at History.module.exports.History.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/history.js:122:16)
  at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:687:27)
  at TextEditor.module.exports.TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:1195:26)
  at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app/src/text-editor-element.js:304:22)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
  at /usr/share/atom/resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:176:20)

Commands

  3x -1:41.5 editor:newline (atom-text-editor.editor.is-focused)
     -1:33.4 core:backspace (atom-text-editor.editor.is-focused)
     -1:31.2 autocomplete:toggle (atom-text-editor.editor.is-focused)
     -1:29.8 core:move-up (atom-text-editor.editor.is-focused)
     -1:20.2 core:backspace (atom-text-editor.editor.is-focused)
     -0:00.6 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "destroyEmptyPanes": false
  },
  "editor": {
    "invisibles": {}
  }
}

Installed Packages

# User
atom-beautify, v0.21.3
file-icons, v1.5.1
linter, v0.12.0
linter-xmllint, v0.0.5
xml-formatter, v0.8.1

# Dev
No dev packages

Activity

  1. thomasjo commented on Mar 9, 2015

    @thomasjo
    Contributor

    This is in all likelihood a bug in either xml-formatter or linter-xmllint; please verify if you are able to reproduce the problem in safe mode.

  2. maqen commented on May 21, 2015

    @maqen

    I'm unfortunately able to reproduce this in safe mode

    Atom Version: 0.200.0
    System: Mac OS X 10.10.3
    Thrown From: Atom Core

    Stack Trace

    Uncaught TypeError: Cannot read property 'isComment' of undefined

    At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:683
    
    TypeError: Cannot read property 'isComment' of undefined
        at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableCodeAtRow (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:424:71)
        at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableAtRow (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:419:19)
        at TokenizedBuffer.module.exports.TokenizedBuffer.updateFoldableStatus (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:407:25)
        at TokenizedBuffer.module.exports.TokenizedBuffer.handleBufferChange (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:372:20)
        at /Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:57:24
        at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
        at TextBuffer.module.exports.TextBuffer.applyChange (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:556:20)
        at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:717:16)
        at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:681:14)
        at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1132:26)
    

    Commands

         -0:05.9.0 core:paste (atom-text-editor.editor.is-focused)
         -0:04.8.0 core:undo (atom-text-editor.editor.is-focused)
         -0:00.5.0 core:paste (atom-text-editor.editor.is-focused)
    

    Config

    {
      "core": {
        "themes": [
          "atom-dark-ui",
          "solarized-dark-syntax"
        ],
        "disabledPackages": [
          "coffee-lint",
          "language-haml",
          "run-command"
        ]
      },
      "editor": {
        "showIndentGuide": true,
        "invisibles": {},
        "scrollPastEnd": true,
        "softWrap": true
      }
    }

    Installed Packages

    # User
    No installed packages
    
    # Dev
    No dev packages
  3. mnquintana commented on May 21, 2015

    @mnquintana
    Contributor

    @maqen Could you upload an example file that throws this error to a Gist?

  4. Glavin001 commented on May 23, 2015

    @Glavin001
    Contributor

    I just experienced this bug. Here's a Gist: https://gist.github.com/Glavin001/c42ec72dc17fa9b7127c
    My Gist includes the file I was typing, and what I did that was reproducing it. However after I pasted on top of the file it no longer causes error. Maybe that cleaned something.

    Update: It appears to also occurs when I paste, not just when I type. This is terrible: I cannot paste into my code...

    Update: I closed my split pane, that I had copied from. I opened up both files as separate tabs. Copied from one, and pasted into the other. It works now! So maybe a combination of pasting / typing + Split pane.

  5. yeldarby commented on May 29, 2015

    @yeldarby

    Getting this error as well but when copy/pasting between two php files. Can confirm that it occurs when copying from one split pane and pasting into another and that the error does not occur if I am not using split panes but instead have them in tabs.

    The bug is not consistently reproducible though. I just tried to open the file in a split pane again and it works now.

  6. henriquebremenkanp commented on Jun 3, 2015

    @henriquebremenkanp

    Atom 0.204.0
    Mac OSX 10.10.3
    Some packages installed.

    This is how I can reproduce the issue:
    zk4nl4efu8

    I think the problem is related to duplicated files in different tabs, which is the default behaviour when you create a new tab. On that new tab, having the old one still open, copy and paste a function will lead to this error. Anyway, closing the previously open tab and keeping the new one makes it work again.
    Sorry for my bad english. I hope it helps someone.

  7. izuzak commented on Jun 10, 2015

    @izuzak
    Contributor

    @henriquebremenkanp @yeldarby Can you try reproducing this in Atom 0.208.0? I just tried following @henriquebremenkanp's instructions and wasn't able to reproduce, so wondering if you're seeing the same.

    Also cc-ing @nathansobo for another pair of 👀 (it seems that some users were running into this with no packages installed).

  8. izuzak commented on Jun 13, 2015

    @izuzak
    Contributor

    Reported again over at #7260:

    Using the editor:move-line-up command while editing a markdown document caused the line highlighted to disappear and the following error to be thrown.

  9. Eschon commented on Jun 16, 2015

    @Eschon

    This error happened for me today

    [Enter steps to reproduce below:]

    I was just switching between tabs.

    Atom Version: 0.209.0
    System: Mac OS X 10.10.3
    Thrown From: Atom Core

    Stack Trace

    Uncaught TypeError: Cannot read property 'isComment' of undefined

    At /Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:451
    
    TypeError: Cannot read property 'isComment' of undefined
      at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableCodeAtRow (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:451:71)
      at TokenizedBuffer.module.exports.TokenizedBuffer.isFoldableAtRow (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:445:21)
      at TokenizedBuffer.module.exports.TokenizedBuffer.updateFoldableStatus (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:430:25)
      at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:311:22)
      at /Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:271:26
      at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:666:47
    
    

    Commands

         -0:05.4.0 core:save (atom-text-editor.editor.is-focused)
    

    Config

    {
      "core": {
        "themes": [
          "one-dark-ui",
          "solarized-dark-syntax"
        ],
        "disabledPackages": [
          "image-view",
          "background-tips",
          "language-go",
          "language-less",
          "language-property-list",
          "language-todo",
          "language-toml",
          "spell-check",
          "bookmarks",
          "welcome",
          "autoflow",
          "merge-conflicts",
          "markdown-preview",
          "go-to-line",
          "language-c",
          "language-csharp",
          "language-java",
          "language-objective-c",
          "language-perl",
          "language-php",
          "language-python",
          "package-generator",
          "linter-tidy"
        ]
      },
      "editor": {
        "invisibles": {},
        "softWrapAtPreferredLineLength": true,
        "showInvisibles": true,
        "scrollPastEnd": true
      }
    }

    Installed Packages

    # User
    atom-handlebars, v0.5.0
    atom-ternjs, v0.6.4
    color-picker, v2.0.4
    linter, v0.12.7
    linter-csslint, v0.0.13
    linter-jscs, v1.12.0
    linter-jshint, v0.1.6
    linter-rubocop, v0.2.7
    linter-xmllint, v0.0.6
    pretty-json, v0.3.3
    tabs-to-spaces, v0.11.0
    
    # Dev
    No dev packages
  10. removed their assignment
    on Jul 23, 2015
  11. stale commented on Jul 22, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  12. lock commented on Mar 31, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  13. locked and limited conversation to collaborators on Mar 31, 2018
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