This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Uncaught TypeError: Cannot read property 'length' of undefined #18837
Copy link
Copy link
Closed
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Sometimes when restoring a session (rendering content?) an uncaught error is thrown.
Steps to Reproduce
- Unknown, saw while restoring a session on restarting Atom.
Expected behavior: [What you expect to happen]
No crash
Actual behavior: [What actually happens]
Stack Trace
Uncaught TypeError: Cannot read property 'length' of undefined
At C:\Users\Lando\AppData\Local\atom\app-1.37.0-nightly0\resources\app\static\<embedded>:14
TypeError: Cannot read property 'length' of undefined
at DisplayLayer.updateSpatialIndex (~/AppData/Local/atom/app-1.37.0-nightly0/resources/app/static/<embedded>:14:93829)
at DisplayLayer.populateSpatialIndexIfNeeded (~/AppData/Local/atom/app-1.37.0-nightly0/resources/app/static/<embedded>:14:94974)
at DisplayLayer.doBackgroundWork (~/AppData/Local/atom/app-1.37.0-nightly0/resources/app/static/<embedded>:14:81248)
at TextEditor.doBackgroundWork (~/AppData/Local/atom/app-1.37.0-nightly0/resources/app/static/<embedded>:11:641)
Reproduces how often: [What percentage of the time does it reproduce?]
Unknown, however it looks like this has been happening since at least v1.32.2.
Versions
OS: Microsoft Windows 10 Pro x64
Atom : 1.37.0-nightly0
Electron: 3.1.3
Chrome : 66.0.3359.181
Node : 10.2.0
apm 2.1.3
npm 6.2.0
node 8.9.3 x64
atom 1.37.0-nightly0
python 2.7.15
git 2.20.1.windows.1
visual studio 2015
Non-Core Packages
atom-beautify 0.33.4
atom-ide-debugger-node 0.7.3
atom-ide-debugger-python 0.7.3
atom-ide-ui 0.13.0
atom-linter-phpstan 1.0.2
atom-material-ui 2.1.3
autoclose-html 0.23.0
autocomplete-lua 0.9.1
busy-signal 2.0.0
docblockr 0.13.7
editorconfig 2.2.2
file-watcher 2.0.0
highlight-selected 0.14.0
ide-bash 1.0.11
ide-flowtype 0.24.0
ide-php 0.7.18
ide-powershell 0.1.0
ide-python 1.2.0
ide-typescript 0.8.0
intentions 1.1.5
language-ansible 0.2.2
language-batch 0.4.0
language-chef 3.5.1
language-cjson 0.0.1
language-docker 1.1.8
language-elixir 0.22.1
language-erlang 3.2.0
language-fortran 2.1.7
language-gettext 0.6.1
language-glsl 2.0.4
language-haml 0.32.1
language-haskell 1.18.0
language-icinga2 0.4.1
language-ini 1.20.0
language-jolie 0.5.0
language-kotlin 0.5.0
language-livescript 0.0.3
language-lua 0.9.11
language-moonscript 1.7.1
language-postcss 1.3.1
language-powershell 5.0.0
language-pug 0.0.22
language-puppet 0.23.0
language-reg 0.0.0
language-rust 0.4.12
language-swift 0.5.0
language-terraform 0.8.1
language-vue 0.24.0
linter 2.3.0
linter-coffeelint 2.0.1
linter-eslint 8.5.2
linter-flake8 2.4.0
linter-htmlhint 1.6.0
linter-js-standard 6.1.0
linter-js-yaml 1.4.2
linter-jsonlint 1.4.0
linter-markdown 5.2.2
linter-perl 0.9.0
linter-perlcritic 2.2.2
linter-php 1.6.0
linter-phpcs 1.6.12
linter-phpmd 2.0.1
linter-proselint 3.3.0
linter-pylama 0.10.1
linter-pylint 2.1.1
linter-rails-best-practices 0.2.2
linter-reek 2.4.1
linter-rubocop 2.2.3
linter-ruby 1.3.0
linter-stylelint 4.4.3
linter-tidy 2.4.0
linter-ui-default 1.7.1
linter-ui-plus 0.3.2
mapfile-grammar 0.1.0
minimap 4.29.9
minimap-git-diff 4.3.1
minimap-highlight-selected 4.6.1
minimap-linter 2.2.1
minimap-selection 4.5.0
sequential-number 0.5.0
sort-lines 0.18.0
sync-settings 0.8.6
tab-control 0.6.11
teletype 0.13.3
terminal-tab 0.5.7
terminal-tab-service 0.1.4
toggle-quotes 1.1.3
town-crier 0.3.0
trailing-spaces 0.4.0
Additional Information
Also reported here:
- Uncaught TypeError: Cannot read property 'length' of undefined #18251 (comment) (Atom v1.32.2)
- Uncaught TypeError: Cannot read property 'length' of undefined #18783 (comment) (Atom v1.34.0)
However as the title is common to other issues this wasn't seen as a separate problem.
Activity
Arcanemagus commentedon Feb 13, 2019
Related stack trace:
Arcanemagus commentedon Feb 13, 2019
I suspect that this is due to
this.screenLineLengthsbeing uninitialized here, but I can't see how that could happen.Aerijo commentedon Feb 13, 2019
@Arcanemagus Easily, if
params.spatialIndexis not falsey (including not 0; is this a potential problem?) andparams.screenLineLengthsisundefined.That also appears to be the only assignment to that property in the TextEditor, and seems like an odd thing for external parts to change.
Arcanemagus commentedon Feb 13, 2019
Well yes, that's the obvious way, but I couldn't find any instance of that outside
atom/text-buffer.That's the only variable that has
.lengthaccessed and isn't defined within that function though.Aerijo commentedon Feb 13, 2019
At times like this I wish we were using TypeScript. I've never know quite where those params came from.
rafeca commentedon May 15, 2019
Since this issue was already happening in v1.32.2 an v1.34, it does not look like an electron v3 issue, so I've removed the label.
stale commentedon May 15, 2020
Thanks for your contribution!
This issue has been automatically marked as stale because it has not had recent activity. Because the Atom team treats their issues as their backlog, stale issues are closed. If you would like this issue to remain open:
Issues that are labeled as triaged will not be automatically marked as stale.