Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of null (reading 'map') #77

Closed
karthiknadig opened this issue Jun 21, 2022 · 4 comments · Fixed by #146
Closed

TypeError: Cannot read properties of null (reading 'map') #77

karthiknadig opened this issue Jun 21, 2022 · 4 comments · Fixed by #146
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers needs PR
Milestone

Comments

@karthiknadig
Copy link
Member

[2022-06-21 10:42:13.425] [renderer1] [error] Cannot read properties of null (reading 'map'): TypeError: Cannot read properties of null (reading 'map')
	at g (/home/buda/.vscode/extensions/ms-python.isort-2022.3.11671003/dist/extension.js:1:213014)
	at Object.asCodeAction (/home/buda/.vscode/extensions/ms-python.isort-2022.3.11671003/dist/extension.js:1:223954)
	at /home/buda/.vscode/extensions/ms-python.isort-2022.3.11671003/dist/extension.js:1:152688
	at async U.provideCodeActions (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:103131)

Filed by @SandroJijavadze here #53 (comment)

@karthiknadig
Copy link
Member Author

  ERR Cannot read properties of null (reading 'map'): TypeError: Cannot read properties of null (reading 'map')
    at asDiagnostics (c:\GIT\formatters\vscode-isort\dist\webpack:\isort\node_modules\vscode-languageclient\lib\common\protocolConverter.js:34:1)
    at Object.asCodeAction (c:\GIT\formatters\vscode-isort\dist\webpack:\isort\node_modules\vscode-languageclient\lib\common\protocolConverter.js:598:1)
    at c:\GIT\formatters\vscode-isort\dist\webpack:\isort\node_modules\vscode-languageclient\lib\common\client.js:1226:1
    at A.provideCodeActions (c:\Users\Karthik Nadig\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:92:42766)

This seems to occur due to us returning code actions even when it is not needed. In def code_action_organize_imports(params: lsp.CodeActionParams) in server.py we return both organize and quick fix code actions in all cases. We should only be retrning quickfix if one is needed. We should not be returning the organize code action when providing a quickfix.

@karthiknadig karthiknadig removed their assignment Oct 15, 2022
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers needs PR and removed triage-needed Issue is not triaged. labels Oct 15, 2022
@gagandeepp
Copy link

@karthiknadig interested please assign

@antonag32
Copy link

Also happening to me.

[2022-10-19 22:55:18.779] [exthost] [error] [ms-python.isort] provider FAILED
[2022-10-19 22:55:18.779] [exthost] [error] TypeError: Cannot read properties of null (reading 'map')
	at g (/home/odoo/.vscode-server/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:212952)
	at Object.asCodeAction (/home/odoo/.vscode-server/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:223892)
	at /home/odoo/.vscode-server/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:152626
	at async A.provideCodeActions (/home/odoo/.vscode-server/bin/64bbfbf67ada9953918d72e1df2f4d8e537d340e/out/vs/workbench/api/node/extensionHostProcess.js:92:42766)

@carlwr
Copy link

carlwr commented Oct 21, 2022

My debug log (Output -> Log (Window)) is littered with these messages.

Seems to be related: #18

One of the messages:

[2022-10-21 14:25:33.369] [renderer1] [error] Cannot read properties of null (reading 'map'): TypeError: Cannot read properties of null (reading 'map')
    at g (/Users/<user>/.vscode/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:213014)
    at Object.asCodeAction (/Users/<user>/.vscode/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:223954)
    at /Users/<user>/.vscode/extensions/ms-python.isort-2022.2.0/dist/extension.js:1:152688
    at A.provideCodeActions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:92:42766)

VS Code versions:

Version: 1.72.2
Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
Date: 2022-10-12T22:15:55.763Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Good for newcomers needs PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants