question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'length' of undefined

See original GitHub issue

VS Code version

1.63.1

Extension version

2021.12.1559732655

OS type

Windows

OS version

windows 11 fully updated, running wsl 2 on ubuntu 20.10, running remote container extension using python image

Python distribution

python.org

Python version

3.9.9

Language server

Pylance

Expected behaviour

ideally python extension doesn’t crash, and it worked before

Actual behaviour

[renderer1] [error] Cannot read property ‘length’ of undefined: TypeError: Cannot read property ‘length’ of undefined at /root/.vscode-server/extensions/ms-python.python-2021.12.1559732655/out/client/extension.js:67:257359 at p (/root/.vscode-server/extensions/ms-python.python-2021.12.1559732655/out/client/extension.js:67:262355) at async z.provideCompletionItems (/root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/out/vs/server/remoteExtensionHostProcess.js:95:101516)

Steps to reproduce

is triggered by code suggestions with any python code and then it crashes the extension.

in a new window, new file type from datetime import and trigger code suggestion, no suggestions are show and extension is crashed

Also found this https://github.com/microsoft/vscode/issues/110467 but i don’t have two versions installed at the same time, and I’ve checked inside the container too.

Logs

[Info - 7:21:53 AM] Pylance language server 2021.12.2 (pyright 211ebe44) starting [Info - 7:21:53 AM] Server root directory: /root/.vscode-server/extensions/ms-python.vscode-pylance-2021.12.2/dist [Info - 7:21:53 AM] No configuration file found. [Info - 7:21:53 AM] No pyproject.toml file found. [Info - 7:21:53 AM] Setting pythonPath for service “workspace”: “/usr/local/bin/python” [Warn - 7:21:53 AM] stubPath /workspace/typings is not a valid directory. [Info - 7:21:53 AM] Assuming Python version 3.9 [Info - 7:21:53 AM] Assuming Python platform Linux [Warn - 7:21:53 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js [Warn - 7:21:53 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js [Warn - 7:21:53 AM] Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js [Info - 7:21:53 AM] Searching for source files [Info - 7:21:53 AM] Found 220 source files [Info - 7:21:53 AM] Background analysis(1) root directory: /root/.vscode-server/extensions/ms-python.vscode-pylance-2021.12.2/dist [Info - 7:21:53 AM] Background analysis(1) started

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

2reactions
kimadelinecommented, Dec 22, 2021

Awesome! This fix will make it in the next stable release of the extension by the end of January.

2reactions
DonJayamannecommented, Dec 21, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'length') - TrackJS
This message indicates that our code expects to have an object with a length property, but that object was not present. length is...
Read more >
Typeerror: Cannot Read Property 'length' of Undefined
A typeerror length of undefined can indicate that the actual type of an operand is different from the expected type. This error can...
Read more >
[SOLVED] Cannot Read Property 'length' of Undefined in JS
4 Quick Fixes for the “Cannot Read Property 'length' of Undefined” Error in JavaScript · 1. Use an if Statement · 2. Use...
Read more >
Cannot read property length of undefined - Stack Overflow
The error means that what ever element is returned by getElementById('WallSearch') , it does not have a value property. Every form field has...
Read more >
TypeError: Cannot read property 'length' of Undefined in JS
The "Cannot read property 'length' of undefined" error occurs when accessing the length property on an undefined value. To solve the error, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found