Skip to content

Extension crashes on recent VS Code versions: util.isNullOrUndefined is not a function #25

Description

@yubedev

The extension crashes on startup with recent versions of VS Code.

Extension Host reports:

TypeError: util.isNullOrUndefined is not a function

This is caused by util.isNullOrUndefined(), which has been deprecated for years and removed from the Node.js runtime bundled with recent VS Code releases.

The offending code is here:

if (util.isNullOrUndefined(frame.file) && frame.address) {

Current code:

if (util.isNullOrUndefined(frame.file) && frame.address) {

Replace it with:

if (frame.file == null && frame.address) {

or equivalently:

if ((frame.file === null || frame.file === undefined) && frame.address) {

I tested this fix on v0.3.0+
Visual Studio Code 1.129.0
Windows 11

Workaround

If the project is no longer maintained, the installed extension can be patched manually.

Edit:

%USERPROFILE%\.vscode\extensions\cl.stm8-debug-<version>\dist\extension.js

Replace:

if(p.isNullOrUndefined(t.file)&&t.address)

with:

if(t.file==null&&t.address)

Save the file and restart VS Code.

This fixes the extension for recent versions of VS Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions