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 'length' of undefined #16892

Closed

Description

@edalexfancher

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Mac OS X 10.13.3
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property 'length' of undefined

At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329

TypeError: Cannot read property 'length' of undefined
    at ScreenLineBuilder.emitText (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329:30)
    at ScreenLineBuilder.buildScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:141:22)
    at DisplayLayer.getScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:643:41)
    at TextEditorComponent.queryScreenLinesToRender (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:867:57)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:376:16)
    at TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:274:16)
    at TextEditorComponent.didMouseWheel (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1550:59)

Commands

     -1:56.7.0 snippets:expand (input.hidden-input)
     -1:56.7.0 editor:indent (input.hidden-input)
  6x -1:56.2.0 core:backspace (input.hidden-input)
     -1:49.1.0 core:save (input.hidden-input)
     -1:45.7.0 editor:newline (input.hidden-input)
     -1:44.3.0 core:save (input.hidden-input)
     -1:16.3.0 emmet:toggle-comment (input.hidden-input)
     -1:16.3.0 editor:toggle-line-comments (input.hidden-input)
  3x -1:15.9.0 core:save (input.hidden-input)
     -0:33.8.0 core:backspace (input.hidden-input)
     -0:32.9.0 core:save (input.hidden-input)
     -0:28.5.0 find-and-replace:show (input.hidden-input)
  3x -0:26.8.0 core:backspace (input.hidden-input)
  4x -0:25.9.0 core:confirm (input.hidden-input)
     -0:19.5.0 editor:newline (input.hidden-input)
  4x -0:18.3.0 core:confirm (input.hidden-input)

Non-Core Packages

2-dark-syntax 1.1.0 
atom-html-preview 0.2.5 
atom-terminal 0.8.0 
blessed-dark-syntax 0.3.0 
city-lights-syntax 1.1.2 
city-lights-ui 1.1.7 
emmet 2.4.3 
snow-dark-syntax 0.1.1 
sort-lines 0.18.0 
terminal-plus 0.14.5 

Activity

  1. rsese commented on Mar 6, 2018

    @rsese
    Contributor

    Thanks for the report! Can you confirm a few things for us?

    • what were you doing at the time of the error?
    • is the error is reproducible?
    • if reproducible, do you see the error in safe mode (atom --safe)?
  2. dixonwille commented on Mar 7, 2018

    @dixonwille

    @rsese I am able to reproduce in safe mode. When not in safe mode it pops up really often. In safe mode not so much. There is one specific file that if I remember correctly I used the collapse lines.

  3. dixonwille commented on Mar 7, 2018

    @dixonwille

    Just switched from One Dark to Atom Dark theme and unable to reproduce now?

  4. davisk4rpi commented on Mar 7, 2018

    @davisk4rpi

    Could you try running atom --clear-window-state? I suggest reading the link below first as "Clearing the saved state permanently destroys any state that Atom has saved across all projects"

    https://flight-manual.atom.io/hacking-atom/sections/debugging/#clearing-saved-state

  5. dixonwille commented on Mar 7, 2018

    @dixonwille

    @davisk4rpi as mentioned above I am unable to reproduce now (changed themes back and still unable to reproduce). Wish I could be of more help.

  6. alxtz commented on Mar 8, 2018

    @alxtz

    I've also faced the same issue, I think this is quite critical since the editor would freeze forever unless you clear the window state manually.

  7. edalexfancher commented on Mar 8, 2018

    @edalexfancher
    Author
  8. rsese commented on Mar 8, 2018

    @rsese
    Contributor

    Does anyone have specific steps to reproduce the error? And if you can still reproduce, is it reproducible for you in safe mode?

    Also curious if you can share your community package list, I wonder if there's anything in common (apm list --installed).

  9. probkiller commented on Mar 10, 2018

    @probkiller

    Atom had been crashing frequently for me for the past couple of days and this problem cropped up today. Don't remember what triggered this. But clearing window state helped. Will post an update if the problem reappears

  10. fergusmeiklejohn commented on Mar 23, 2018

    @fergusmeiklejohn

    To see this bug I:
    Worked on a elm file in Atom.
    Closed Atom
    Worked on the same Elm file in JetBrains Rider
    Save and close Rider
    Open Atom
    Bug appears:
    Uncaught TypeError: Cannot read property 'length' of undefined
    /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329

    To fix
    Quit Atom
    atom --clear-window-state

  11. rsese commented on Mar 23, 2018

    @rsese
    Contributor

    Thanks @fergusmeiklejohn - with those steps can you reproduce in safe mode?

  12. AldonIsenberg11 commented on Mar 26, 2018

    @AldonIsenberg11

    apm list --installed
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    └── [email protected]


    screen shot 2018-03-26 at 3 29 21 pm

  13. FernandoGOT commented on Apr 5, 2018

    @FernandoGOT

    Just got the same problem, for some reason wen I try to open one project (this happen only at this project) the developer tools window is opened and so the atom stop working for this project. All other projects can run normally at the same time.

    Reseting the window state atom --clear-window-state worked for me

  14. 9 remaining items

  15. josfaber commented on Jul 4, 2018

    @josfaber

    Reseting the window state atom --clear-window-state worked for me too.

    The problem showed up this morning, errors seemed to be triggered from the minimap package. On disabling minimap, the linter-ui-default began causing the error. Disabling that package, the error came from atom/atom.

    Now on Atom Mac, before the error the file was edited on Atom Windows and then pushed into Bitbucket.

  16. beginrescueend commented on Aug 7, 2018

    @beginrescueend

    Today (2018-08-07), I also get "Uncaught TypeError: Cannot read property 'length' of undefined" on my Mac (High Sierra 10.13.6). It did this before I updated Atom and all packages and it also did it after I updated everything. I also got the minimap error, reported above on July 4. ^^

    It did it repeatedly, but only if I opened files that Atom knew about in its history. If I did atom --help or atom -? or if I did atom <file that does not exist>, it would work.

    Just atom or atom <file that generated the error>, it would crash with the above error message. It also did it in atom --safe mode.

    After I closed all files in atom's history and closing atom, I can no longer reproduce the issue. It now works, again.

  17. alisianoi commented on Aug 28, 2018

    @alisianoi

    Subscribing. My two cents:

    Similar to #16892 (comment), I was using collapse lines (collapsed many different blocks, collapsed/uncollapsed the same blocks several times). This is the first time I used collapsing feature, did not have this problem at all before (when not using collapsing feature).

    Similar to #16892 (comment) my theme is One Dark.

  18. chokri commented on Sep 21, 2018

    @chokri

    [Enter steps to reproduce:]

    1. ...
    2. ...

    Atom: 1.25.0 x64
    Electron: 1.7.11
    OS: Ubuntu 18.04.1
    Thrown From: Atom Core

    Stack Trace

    Uncaught TypeError: Cannot read property 'length' of undefined

    At /usr/share/atom/resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329
    
    TypeError: Cannot read property 'length' of undefined
        at ScreenLineBuilder.emitText (/usr/share/atom/resources/app/node_modules/text-buffer/lib/screen-line-builder.js:329:30)
        at ScreenLineBuilder.buildScreenLines (/usr/share/atom/resources/app/node_modules/text-buffer/lib/screen-line-builder.js:141:22)
        at DisplayLayer.getScreenLines (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-layer.js:643:41)
        at TextEditorComponent.queryScreenLinesToRender (/usr/share/atom/resources/app/src/text-editor-component.js:870:57)
        at TextEditorComponent.updateSyncBeforeMeasuringContent (/usr/share/atom/resources/app/src/text-editor-component.js:377:16)
        at TextEditorComponent.updateSync (/usr/share/atom/resources/app/src/text-editor-component.js:275:16)
        at etch.getScheduler.updateDocument (/usr/share/atom/resources/app/src/text-editor-component.js:225:46)
        at ViewRegistry.performDocumentUpdate (/usr/share/atom/resources/app/src/view-registry.js:238:13)
    

    Commands

    Non-Core Packages

    atom-beautify 0.33.1 
    atom-eclipse-syntax 0.0.6 
    atom-material-syntax 1.0.8 
    atom-material-syntax-light 0.4.6 
    atom-material-ui 2.1.3 
    autumn-highlighter-syntax 1.13.0 
    ayu 0.1.0 
    ayu-mirage-atom-syntax 1.0.2 
    ayu-mirage-ish-syntax 1.1.0 
    city-lights-syntax 1.1.8 
    city-lights-ui 1.5.3 
    file-icons 2.1.24 
    isotope-light-ui 2.3.0 
    language-cmake 1.1.0 
    language-ejs 0.4.0 
    php-twig 4.0.0 
    piatto-light-syntax 0.2.2 
    platformio-ide-terminal 2.8.4 
    spacegray-light-neue-ui 0.1.7 
    two-light-ui 1.1.3 
    
  19. Ben3eeE commented on Sep 21, 2018

    @Ben3eeE
    Contributor

    @chokri You Atom version is very old and there has been many fixes regarding the error you are seeing since then.

    @alisianoi There are some bugs with folding that you may want to subscribe to I believe #16078 could cause this error.

    @beginrescueend If you get this after updating a package with an error from that package I believe it's an error with this package and should be filed there. Before you file any issues there please ensure you are using the latest version of Atom since we have fixed some bugs for this in the 1.2X releases.

  20. Ben3eeE commented on Sep 21, 2018

    @Ben3eeE
    Contributor

    To be able to move forward with this issue we are going to require some steps to reproduce the problem. Don't hesitate to reach out if you have steps to reproduce in a recent release of Atom.

  21. nickanna42 commented on Oct 1, 2018

    @nickanna42

    Same issue
    [Enter steps to reproduce:]

    1. Update to latest version of Atom
    2. Start atom

    Atom: 1.31.1 x64
    Electron: 2.0.7
    OS: Mac OS X 10.12.6
    Thrown From: Atom Core

    Stack Trace

    Uncaught TypeError: Cannot read property 'length' of undefined

    At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:328
    
    TypeError: Cannot read property 'length' of undefined
        at ScreenLineBuilder.emitText (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:328:31)
        at ScreenLineBuilder.buildScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/screen-line-builder.js:140:22)
        at DisplayLayer.getScreenLines (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/display-layer.js:643:41)
        at TextEditorComponent.queryScreenLinesToRender (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:871:57)
        at TextEditorComponent.updateSyncBeforeMeasuringContent (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:386:16)
        at TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:276:16)
        at TextEditorComponent.didMouseWheel (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1560:59)
    

    Commands

         -4:10.7.0 minimap:toggle (input.hidden-input)
    

    Non-Core Packages

    atom-beautify 0.33.4 
    atom-minify 0.8.0 
    atom-ternjs 0.18.3 
    autoclose-html 0.23.0 
    hyperclick 0.1.5 
    language-babel 2.85.0 
    lint 0.0.1 
    MavensMate-Atom 1.1.0 
    minimap 4.29.9 
    split-diff 1.5.2 
    teletype 0.13.3 
    
  22. nickanna42 commented on Oct 1, 2018

    @nickanna42

    RTFM:
    I closed all files in all open windows, closed all windows, ran atom --clear-window-state, and problem resolved itself

  23. Houley01 commented on Oct 15, 2018

    @Houley01

    Was editing python file and came up with and error

    C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\node_modules\text-buffer\lib\screen-line-builder.js:328
    Hide Stack Trace
    TypeError: Cannot read property 'length' of undefined
    at ScreenLineBuilder.emitText (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\node_modules\text-buffer\lib\screen-line-builder.js:328:31)
    at ScreenLineBuilder.buildScreenLines (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\node_modules\text-buffer\lib\screen-line-builder.js:140:22)
    at DisplayLayer.getScreenLines (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\node_modules\text-buffer\lib\display-layer.js:643:41)
    at TextEditorComponent.queryScreenLinesToRender (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\src\text-editor-component.js:871:57)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\src\text-editor-component.js:386:16)
    at TextEditorComponent.updateSync (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\src\text-editor-component.js:276:16)
    at etch.getScheduler.updateDocument (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\src\text-editor-component.js:226:46)
    at ViewRegistry.performDocumentUpdate (C:\Users\username\AppData\Local\atom\app-1.31.2\resources\app\src\view-registry.js:238:13)

  24. no-response commented on Oct 19, 2018

    @no-response

    This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

  25. lock commented on Apr 17, 2019

    @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!

  26. locked as resolved and limited conversation to collaborators on Apr 17, 2019
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