microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

pylance crashing with cannot read properties of undefined (wsl) #6263

Closed kgskgs closed 2 weeks ago

kgskgs commented 1 month ago

Pylance is crashing and restarting several times a day, seemingly at random.

Environment data

Logs

pylance_logs.txt

the logs are really long cause it looks like it's attempting to dump the whole /home/k/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js. The main thing seems to be

Error: Request python/clientShowMessage failed with message: Cannot read properties of undefined (reading '__client__')
    at ue (/home/k/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1351916)
    at Ae (/home/k/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1350074)
    at Immediate.<anonymous> (/home/k/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1346360)
    at processImmediate (node:internal/timers:478:21)
KacieKK commented 4 weeks ago

Thanks for reporting this issue. Request python/clientShowMessage triggered when opening a folder that contains a large number of files. According to your log, it is intended to open 5167 source files? (I am asking because sometimes that folder contains non-Python files such as test files, image files, etc., yet we still need to scan every file to gather the Python files). I tried to reproduce by opening a huge folder but it did not crash. Could you share the source file or a minimal code sample that repros this issue?

lizardll commented 4 weeks ago

the same, randomly happens: Error: Request python/clientShowMessage failed with message: Cannot read properties of undefined (reading 'client') at ue (/home/xxx/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1351916) at Ae (/home/xxx/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1350074) at Immediate. (/home/xxx/.vscode-server/extensions/ms-python.vscode-pylance-2024.8.1/dist/vendor.bundle.js:2:1346360) at processImmediate (node:internal/timers:478:21)

debonte commented 2 weeks ago

This issue has been fixed in prerelease version 2024.8.103, which we've just released. You can find the changelog here: CHANGELOG.md