microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.67k stars 770 forks source link

too many notifications when pylance crashes #6056

Open amunger opened 3 days ago

amunger commented 3 days ago

Recording 2024-06-25 at 07 22 12

amunger commented 3 days ago

also, pylance is constantly crashing

rchiodo commented 3 days ago

Can you upload the log from the Python Language Server tab? It should show the callstack for the crash.

amunger commented 3 days ago
2024-06-25 10:13:15.764 [info] (Client) Pylance async client (2024.6.1) started with python extension (2024.9.2024062506)
2024-06-25 10:13:17.622 [info] c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1

{the entire contents of that bundle? (2.6m characters)}

TypeError: Cannot read properties of undefined (reading 'split')
    at x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1381535)
    at _0x987c9 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:569922)
    at _0x3bce49 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:569261)
    at e.autoImportDetail (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1438456)
    at 94576 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1288606)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 87472 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\pyright.bundle.js:1:1265878)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 68968 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:915625)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 71880 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:956284)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 3740 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:418670)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 78268 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:3246)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 80332 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:582858)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at 47100 (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1096126)
    at _0x48e40e (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1121829)
    at c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1122070
    at _0x48e40e.O (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1123085)
    at _0x48e40e.x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1122120)
    at _0x48e40e.x (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125636)
    at c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125684
    at Object.<anonymous> (c:\Users\aamunger\.vscode-insiders\extensions\ms-python.vscode-pylance-2024.6.1\dist\server.bundle.js:1:1125724)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:96:12)

Node.js v20.9.0

2024-06-25 10:13:18.376 [info] [Error - 10:13:18 AM] Server process exited with code 1.
2024-06-25 10:13:18.380 [info] [Error - 10:13:18 AM] Server initialization failed.
2024-06-25 10:13:18.380 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-06-25 10:13:18.381 [info] [Error - 10:13:18 AM] Pylance client: couldn't create connection to server.
2024-06-25 10:13:18.381 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
rchiodo commented 3 days ago

Thanks. That's this line of code here: https://github.com/microsoft/pyright/blob/1168be715e64961106b6cd18c01db87ed285d715/packages/pyright-internal/src/localization/localize.ts#L178

What's your locale set to? I don't know how the locale can be undefined but it looks like that's the problem.

amunger commented 3 days ago

I'm not sure how to check that - I don't have any settings for locale set

rchiodo commented 3 days ago

Looking up the callstack, I'm guessing it's coming from a VSCODE env var? https://github.com/microsoft/pyright/blob/1168be715e64961106b6cd18c01db87ed285d715/packages/pyright-internal/src/localization/localize.ts#L121

VSCODE_NLS_CONFIG might be set? And then it just assumes that's a json file and it blindly loads the 'locale' setting in the json file.