MATLAB Language server crashes on startup
Describe the bug The MATLAB Language server crashes as soon as the extension starts. See the screen capture attached:
https://github.com/user-attachments/assets/f1f041a7-2ee3-4088-a270-009a6916342e
Output of MATLAB Language Server:
(11:36:26) matlabls: Log Directory: /tmp/matlabls_98394
(node:98394) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `code --trace-deprecation ...` to show where the warning was created)
(11:36:26) matlabls: Launching MATLAB...
(11:36:26) matlabls: Found MLM_LICENSE_FILE environment variable set to: <matlab license env var here>,. Using it for licensing MATLAB
[Error - 11:36:26] (11:36:26) matlabls - ERROR: Error finding mlint executable in /usr/local/bin
(11:36:37) matlabls: Started MATLAB (session 1)
(11:36:37) matlabls: MATLAB session 1 connected to R2024b
[Error - 11:36:40] (11:36:40) matlabls - ERROR: Timeout when attaching to release: 24b
(11:36:40) matlabls: Retrying attach
(11:36:40) matlabls: MVM attach success
(11:36:40) matlabls: Adding workspace folder(s) to the MATLAB Path:
<project folder here>
(11:36:42) matlabls: CWD set to: <project folder here>
node:internal/process/promises:392
new UnhandledPromiseRejection(reason);
^
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".
at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
at processPromiseRejections (node:internal/process/promises:475:17)
at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v22.15.1
[Info - 11:36:43] Connection to server got closed. Server will restart.
true
(11:36:43) matlabls: Log Directory: /tmp/matlabls_99978
(node:99978) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `code --trace-deprecation ...` to show where the warning was created)
(11:36:43) matlabls: Launching MATLAB...
(11:36:43) matlabls: Found MLM_LICENSE_FILE environment variable set to: <matlab license env var here>,. Using it for licensing MATLAB
[Error - 11:36:43] (11:36:43) matlabls - ERROR: Error finding mlint executable in /usr/local/bin
To Reproduce See screen capture
Useful Information
- MATLAB Version: '24.2.0.2740171 (R2024b) Update 1'
- OS Version: OS: Linux x64 4.18.0-553.54.1.el8_10.x86_64
- VS Code Version: 1.101.2 Commit: 2901c5ac6db8a986a5666c3af51ff804d05af0d4 Date: 2025-06-24T20:27:15.391Z Electron: 35.5.1 ElectronBuildId: 11727614 Chromium: 134.0.6998.205 Node.js: 22.15.1 V8: 13.4.114.21-electron.0
Additional context This started happening recently. Maybe it only happens in version 1.101.2 of VS Code.
Thanks for reporting this!
This may be related to #290 - can you share what version of the MATLAB extension you have installed?
Does this happen every time, or only sporadically?
Sorry, forgot to mention it. I have the latest version of the extension installed (1.3.6).
It happens every time.
Can you try installing v1.3.5 instead, and letting me know if that resolves the problem? This will help to narrow down the set of changes which this may be coming from.
You can do this by:
- Go to the Extensions side panel in VS Code
- Click the ⚙️ icon next to the MATLAB extension
- Select "Install Specific Version..."
After selecting v1.3.5, I would recommend restarting VS Code to ensure the change takes effect.
Hi, I can confirm that the issue also happens on v1.3.5
The issue is also happening on v1.3.7.
MATLAB Version: '24.2.0.2740171 (R2024b) Update 1' OS Version: OS: Linux x64 4.18.0-553.54.1.el8_10.x86_64 VS Code Version: 1.101.2 Commit: 2901c5ac6db8a986a5666c3af51ff804d05af0d4 Date: 2025-06-24T20:27:15.391Z Electron: 35.5.1 ElectronBuildId: 11727614 Chromium: 134.0.6998.205 Node.js: 22.15.1 V8: 13.4.114.21-electron.0
I don't think it's a problem with the node version. I'm now experiencing the same problem on this configuration:
Extension version: 1.3.7 MATLAB Version: '24.2.0.2740171 (R2024b) Update 1' OS version: Windows_NT x64 10.0.19045 VS Code Version: 1.85.2 (system setup) Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681 Date: 2024-01-18T06:40:10.514Z Electron: 25.9.7 ElectronBuildId: 26354273 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0
Thanks for the extra information!
We will continue looking into this, but may reach out for further debugging assistance if we are unable to reproduce or have other questions.
One more thing to check in the meantime:
It appears, based on the above error log, that you have a workspace set up with at least one folder.
Does this issue only occur when you have a workspace set up in VS Code, or are you able to connect to MATLAB when there is no workspace?
The issue only occurs when I have a workspace set up in VS Code. I'm able to connect to MATLAB normally when there is no workspace.
I only recently experienced this error, but I get the same error all the way back to version 1.2.0