2025-12-16 3:35 PM
I have a vscode task that allows me to just flash the application using `cube` which has worked fine until I got the lastest extensions update where now running this task will give a "The "path" argument must be of type string. Received undefined" error.
The task definition (tasks.json):
"type": "shell",
"label": "Program flash",
"command": "cube",
"args": [
"programmer",
"-c",
"port=SWD",
"-d",
"${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}",
"-g"
],
"problemMatcher": [], Part of the error log:
025-12-16 23:18:12.319 [error] TypeError: The "path" argument must be of type string. Received undefined
at Object.basename (node:path:911:5)
at n (c:\Users\user\.vscode\extensions\stmicroelectronics.stm32cube-ide-debug-core-1.1.0\lib\extension.js:435:4173)
at c:\Users\user\.vscode\extensions\stmicroelectronics.stm32cube-ide-debug-core-1.1.0\lib\extension.js:435:4493How can I resolve this?
Thanks!
2025-12-16 11:18 PM
Hi @AHugh.2 ,
Please replace the VSCode command :
${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}with the path to the binary file.
You can use the variable ${workspaceFolder} or an absolute path
${workspaceFolder}/path/to/the/binary
KR,
Flo
2025-12-17 6:38 AM
Thanks for this. However I'm not keen on using explicit paths like this - the previous solution worked nicely since it would deal with configuration/preset changes where the output binary is put into different directories depending on the selected configuration/preset (e.g. debug / release).
Is there any other way to avoid any explicit paths?
2025-12-18 12:50 AM
To be honest, before it worked by chance and caused problems in other cases.
The arguments received during the resolution of the VSCode command vary depending on the context (launch.json, tasks.json, etc.).
The process is now safer, but less convenient in your case. I will investigate how to improve it.
KR,
Flo