Cannot read property 'toCommandArgument' of undefined
See original GitHub issueEnvironment data
VS Code version: 1.19.3 Python Extension version: 2018.1.0 Python Version: 3.6.4 (x86) OS and version: WIndows 10 x64
Actual behavior
Getting an error when running “Run Python File in Terminal” using a key binding
Error: Cannot read property 'toCommandArgument' of undefined
at TerminalCodeExecutionProvider.<anonymous> (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:44:99)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:15:58)
at <anonymous>
Expected behavior
The python file should be executed without error.
Steps to reproduce:
I was able to reproduce this with a fresh new install of vscode and the python extension only
- Install this extension
- Run a python file in terminal using ctrl+shit+P
- Now you can assign a key binding to this command (I used ctrl+alt+P)
- Press ctrl+alt+P on the same file
- A WARN is shown and the file is not executed
Logs
Output from Python
output panel
##########Linting Output - pylint##########
Using config file d:\Programming\ModernGL\.pylintrc
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Output from Console window
(Help->Developer Tools menu)
[Extension Host] Python Extension: Failed to get conda info from conda null
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1226 ERR Cannot read property 'toCommandArgument' of undefined: TypeError: Cannot read property 'toCommandArgument' of undefined
at TerminalCodeExecutionProvider.<anonymous> (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:44:99)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:15:58)
at <anonymous>
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 WARNING: Promise with no error callback:123
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 Object
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] (node:9212) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:249
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1226 ERR Cannot read property 'toCommandArgument' of undefined: TypeError: Cannot read property 'toCommandArgument' of undefined
at TerminalCodeExecutionProvider.<anonymous> (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:44:99)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:15:58)
at <anonymous>
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 WARNING: Promise with no error callback:125
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 Object
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1226 ERR Cannot read property 'toCommandArgument' of undefined: TypeError: Cannot read property 'toCommandArgument' of undefined
at TerminalCodeExecutionProvider.<anonymous> (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:44:99)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Szabi\.vscode\extensions\ms-python.python-2018.1.0\out\client\terminals\codeExecution\terminalCodeExecution.js:15:58)
at <anonymous>
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 WARNING: Promise with no error callback:137
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:156 Object
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:34 (5 by maintainers)
Top Results From Across the Web
Cannot read property 'toCommandArgument' of undefined
Warning when I use keyboard shortcut to run python in terminal VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:36:43.673Z) OS Version: Windows_NT ia32 ...
Read more >vs code key binding (run python script in terminal) no longer ...
Received undefined". ... After that warning changed to "Cannot read property 'toCommandArgument' of undefined" as Henrik says.
Read more >Can Not Read Properties of Undefined Reading Map in React ...
If you are looking at can not read properties of undefined reading map in react js error or map function is not displaying...
Read more >ERROR TypeError: Cannot read property title of undefined
HEY, SET YOUR LIKE THERE ! ... Your browser can't play this video. ... Solved: ERROR TypeError: Cannot read property title of undefined....
Read more >TypeError: Cannot read property 'data' of undefined
catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
end of the month
@Noah-Elbec Please download and install the insiders build from here