As of today trying to debug my project fails with the following error: Cannot read properties of undefined (reading ‘replaceAll’)
Running the “run-container-torizon-release-arm64” task works without any problems (so i presume it should not be a problem with the installed version of docker, like in similiar posts).
Debugging the project, still worked last week.
New projects with the CMake template also fail to debug.
Was there a change in one of the Torizon Extension updates that may have led to this problem?
Is there a debug output, with more information about this error? The only thing I am currently getting is a popup with the mentioned message.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?
Hello! Thank you for your detailed question.
The error message “Cannot read properties of undefined (reading ‘replaceAll’)” suggests there might be an issue within the Torizon extension’s internal scripting—possibly related to a recent update or a subtle misconfiguration.
Debugging Further
You can obtain more detailed debug output from VS Code’s Developer Tools:
Open the Command Palette (Ctrl+Shift+P).
Enter and select Developer: Toggle Developer Tools.
In the new panel, open the Console tab and reproduce the error. Check for related error messages and stack traces, which might reveal more about the failure. See here for reference.
Potential Causes & Next Steps
Since you mentioned the “run-container-torizon-release-arm64” task works, Docker is likely not the root cause.
The issue affecting both existing and new projects suggests the extension or a related dependency (on the host or VS Code) might have changed recently.
Recent Extension Updates: There have been some reports where updates (VS Code or Torizon extension) introduce incompatibilities, especially if your VS Code is not the latest or unexpectedly updated.
Some versions of Node.js or VS Code ship without the replaceAll string method. Make sure your VS Code is up-to-date.
Actions to Try
Check for Extension Updates:
Go to Extensions in VS Code, search for “Torizon IDE Extension”, and ensure it’s the latest version.
Check Your VS Code Version:
Make sure VS Code is up-to-date. replaceAll became natively available in Node 15+ and VS Code 1.56+.
View the Debug Output:
Check both the Console in Developer Tools and the Terminal output for more logs during the start of the debug session.
If the Issue Persists:
You can also try uninstalling and reinstalling the Torizon extension, as sometimes stale extension state can cause issues.
I’m sorry that you are facing this issues. This was already reported to Microsoft on the VS Code repo. It was fixed but not planning for a release yet .
Meanwhile, a workaround is to change in your project .vscode/launch.json from the following:
it seems close to working now, but for some reason the a debug attempt ends up asking for the password of the verdin, which wouldn’t be a problem, but it seems the default password (which is already defined in the settings.json) doesnt work.
See the error below:
Executing task: DOCKER_HOST=172.16.60.33:2375 LOCAL_REGISTRY=172.16.122.210 TAG=arm64 GPU=-imx8 DEBUG_SSH_PORT=2230 DEBUG_PORT1= DEBUG_PORT2= DEBUG_PORT3= docker compose -p torizon up -d pm2-test-software-debug
WARN[0000] The "DOCKER_LOGIN" variable is not set. Defaulting to a blank string.
WARN[0000] Found orphan containers ([torizon-mainmodule-debug-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 2/2
✔ Container torizon-pm2-test-software-debug-1 Started 5.5s
! pm2-test-software-debug Published ports are discarded when using host network mode 0.0s
* Terminal will be reused by tasks, press any key to close it.
* Executing task: rsync -P -av -e ssh -p 2230 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null /home/aig/95491/software/pm2TestSoftware/build-arm64/bin/ torizon@172.16.60.33:/home/torizon/app
Warning: Permanently added '[172.16.60.33]:2230' (ED25519) to the list of known hosts.
torizon@172.16.60.33's password:
Permission denied, please try again.
torizon@172.16.60.33's password:
Permission denied, please try again.
torizon@172.16.60.33's password:
Connection closed by 172.16.60.33 port 2230
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(232) [sender=3.2.7]
* The terminal process "rsync '-P', '-av', '-e', 'ssh -p 2230 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null', '/home/aig/95491/software/pm2TestSoftware/build-arm64/bin/', 'torizon@172.16.60.33:/home/torizon/app'" terminated with exit code: 255.
I just started a new C++ project on Torizon IDE and I managed to build it, push to the module and debug it with breakpoints working, so I couldn’t reproduce the issue on your side.
My setup:
Host PC: Ubuntu 22.04
VS Code: 1.100.0
Torizon IDE: 3.0.4
Toradex Module
Verdin iMX8MP Q 4GB WB IT V1.1A
Torizon OS 7.2.0-build.13
Could you please share more details of what is happening when you try to use breakpoints?
Maybe some message from DEBUG CONSOLE tab in VS Code? Or some message from the debug task’s terminal?
The big difference to your test environment I am seeing is that my tests are currently running on a Verdin with Torizon OS 6.6.1+build.12.
Which does make sense that new there are problems with the new template if its for Torizon OS 7.
Is there a way to use the older template when generating a project?
Or is it generally adviced to upgrade to Torizon7?
We do recommend following newer releases. Right now, the latest quarterly is Torizon OS 7.2.0 (Download Links | Toradex Developer Center, also directly available via Toradex Easy Installer).
I seems like the OS version is indeed the reason for the debugging problem.
Thank you for the help.
But might I still suggest adding the possibility to select older templates in the IDE, since their might be reasons to still create projects on a maintenance release, like the OS 6.8.
that is good to know.
But it seems like a downgrade from OS7 to OS6, with the “try-update-template”-Task leads to the following error:
Executing task: echo echo 'Templates repo fetched!'
echo Templates repo fetched!
* Terminal will be reused by tasks, press any key to close it.
* Executing task: xonsh /home/aig/95491/software/TestSoftware/pm2TestSoftware/.conf/project-updater.xsh /home/aig/95491/software/TestSoftware/pm2TestSoftware pm2TestSoftware False
File "/home/aig/95491/software/TestSoftware/pm2TestSoftware/.conf/project-updater.xsh", line 618
cp -f @(f"{os.environ['HOME']}/.apollox/{_template_name}/{_update['source']}") .
^
SyntaxError: ('code: @(',)
* The terminal process "xonsh '/home/aig/95491/software/TestSoftware/pm2TestSoftware/.conf/project-updater.xsh', '/home/aig/95491/software/TestSoftware/pm2TestSoftware', 'pm2TestSoftware', 'False'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
This task was designed to help developers to update between minor releases (iow, within the same major version). So it is not expected to be used to update between major releases.
Could you please share details about your use case? Do you need to downgrade a project from Torizon OS 7 to Torizon OS 6?
we have a project currently running on OS6, were we wish to add another application.
But new applications seem to automatically pull the newest template, which is for OS7.
As described before, debugging with the new template in OS6 only seems to work partially and does not support breakpoints.
Sorry: before, I didn’t explicitly say you need to set torizon.templateTag in globalsettings.json (instead of the one from the project). After doing that, you can reload the window and create the Torizon project.