bitfocus / companion-module-homeassistant-server

MIT License
12 stars 7 forks source link

Can't add home assistant instance #5

Closed dseehof closed 3 years ago

dseehof commented 3 years ago

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!

empyfree commented 3 years ago

Same here.

Julusian commented 3 years ago

Sorry, I didnt have notifications turned on for this repo so missed the issues opened here.

This should be fixed in the latest beta build