thoukydides / homebridge-homeconnect

Home Connect home appliances plugin for Homebridge
https://www.thouky.co.uk
ISC License
140 stars 15 forks source link

Config fails to load on Node.js v20.9.0 (latest available on Synology) #304

Closed connor-g closed 4 days ago

connor-g commented 4 days ago

Description of Issue

I'm running the latest HomeBridge and HomeConnect on a Synology, and as far as I can tell the latest version of Node.js offered on Synology is v20.9.0.

Expected Behaviour

Plugin should load successfully on Node.js v20.9.0

Steps to Reproduce

When starting up, plugin emits this output:

[10/7/2024, 9:48:34 AM] The plugin "homebridge-homeconnect" requires Node.js version of ^22.8.0 || ^20.17.0 || ^18.20.4 which does not satisfy the current Node.js version of v20.9.0. You may need to upgrade your installation of Node.js - see https://homebridge.io/w/JTKEF
[10/7/2024, 9:48:34 AM] ====================
[10/7/2024, 9:48:34 AM] ERROR LOADING PLUGIN homebridge-homeconnect:
[10/7/2024, 9:48:34 AM] SyntaxError: Unexpected token 'with'
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
    at callTranslator (node:internal/modules/esm/loader:273:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
[10/7/2024, 9:48:34 AM] ====================

Plugin Version

1.0.4

Environment

Home Connect Appliance(s)

No response

HomeKit App(s)

No response

Diagnostic Checks

Log File

[10/7/2024, 9:48:34 AM] The plugin "homebridge-homeconnect" requires Node.js version of ^22.8.0 || ^20.17.0 || ^18.20.4 which does not satisfy the current Node.js version of v20.9.0. You may need to upgrade your installation of Node.js - see https://homebridge.io/w/JTKEF
[10/7/2024, 9:48:34 AM] ====================
[10/7/2024, 9:48:34 AM] ERROR LOADING PLUGIN homebridge-homeconnect:
[10/7/2024, 9:48:34 AM] SyntaxError: Unexpected token 'with'
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
    at callTranslator (node:internal/modules/esm/loader:273:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
[10/7/2024, 9:48:34 AM] ====================

Configuration

{
    "platform": "HomeConnect",
    "name": "HomeConnect",
    "clientid": "redacted",
    "simulator": false,
    "language": {
        "api": "en-US"
    },
    "THERMADOR-DWHD560CFP-68A40E956B8B": {
        "enabled": false,
        "names": {
            "prefix": {
                "programs": false,
                "other": true
            }
        },
        "features": {
            "Active Program": false,
            "Door": false,
            "Event Buttons": false
        },
        "addprograms": "none",
        "programs": []
    },
    "THERMADOR-T36FT820NS-68A40E8F6603": {
        "enabled": true,
        "names": {
            "prefix": {
                "programs": false,
                "other": true
            }
        },
        "features": {
            "Door": true,
            "Event Buttons": false,
            "Internal Light": false,
            "Freezer Super Mode": false,
            "Fresh Mode": false,
            "Refrigerator Super Mode": false,
            "Vacation Mode": false,
            "Eco Mode": false,
            "Ice Dispenser": false,
            "Sabbath Mode": false,
            "Freezer Door": false,
            "Refrigerator Door": false
        }
    },
    "THERMADOR-PH36GWS-68A40EA35791": {
        "enabled": true,
        "names": {
            "prefix": {
                "programs": false,
                "other": true
            }
        },
        "features": {
            "Event Buttons": false,
            "Functional Light": true
        }
    },
    "THERMADOR-PRG366WH-68A40EA265E3-001": {
        "enabled": false,
        "names": {
            "prefix": {
                "programs": false,
                "other": true
            }
        },
        "features": {
            "Active Program": false,
            "Door": false,
            "Event Buttons": false,
            "Sabbath Mode": false
        },
        "addprograms": "none",
        "programs": []
    },
    "THERMADOR-POM301W-68A40EA40AE3-001": {
        "enabled": false,
        "names": {
            "prefix": {
                "programs": false,
                "other": true
            }
        },
        "features": {
            "Active Program": false,
            "Door": false,
            "Event Buttons": false,
            "Sabbath Mode": false
        },
        "addprograms": "none",
        "programs": []
    }
}

Additional Information

No response

thoukydides commented 4 days ago

This is a duplicate of #300.

A breaking change was made to Node.js, so to work with the latest LTS releases I had to make a change to this plugin that makes it incompatible with earlier versions. The minimum supported Node.js versions should now be: 18.20, 20.10, or 22. However I only test against the latest versions on each LTS branch, which is why the package.json specifies higher versions than these.

You will need to stay on v1.0.3 of this plugin until Synology release a sufficiently up-to-date version of Node.js.

connor-g commented 4 days ago

Thanks for the quick answer!

thoukydides commented 3 days ago

v1.0.5 should restore compatibility with Node.js 20.9.0.