when trying to add home assistant server to companion I'm getting the following error:
module(homeassistant-server): Error loading module: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/dist/haws.umd.js require() of ES modules is not supported. require() of /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/dist/haws.umd.js from /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/dist/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename haws.umd.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/package.json.
Hi,
when trying to add home assistant server to companion I'm getting the following error:
module(homeassistant-server): Error loading module: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/dist/haws.umd.js require() of ES modules is not supported. require() of /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/dist/haws.umd.js from /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/dist/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename haws.umd.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Applications/Companion.app/Contents/Resources/app.asar/lib/module/homeassistant-server/node_modules/home-assistant-js-websocket/package.json.
Any idea what I need to do?
Thanks!