GithubHelp home page GithubHelp logo

[BUG] about homebridge-smart-irrigation HOT 20 CLOSED

mtry avatar mtry commented on June 9, 2024 1
[BUG]

from homebridge-smart-irrigation.

Comments (20)

MTry avatar MTry commented on June 9, 2024 1

Please check now - have merged the changes and this should be working now.

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024 1

Yes.. I bumped the got version as well..

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024

Hi Shane.. just wanted to let you know that I'm trying to replicate this however without success so far.

from homebridge-smart-irrigation.

shanevanj avatar shanevanj commented on June 9, 2024

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024

from homebridge-smart-irrigation.

angyalz avatar angyalz commented on June 9, 2024

Same issue here.
Node: v16.13.2
HomeBridge: v1.4.0

from homebridge-smart-irrigation.

angyalz avatar angyalz commented on June 9, 2024

This issue is absolutely not memory related.
The “require” of ES Module no longer supported for some reason at index.js.
@MTry I think you should change them to “import” of CommonJS – as is in error message.

PS: but I don't understand this error. First of all, I know that require() is from CommonJS and import() from ES Module.
Second: many plugins are working well with require().

from homebridge-smart-irrigation.

shanevanj avatar shanevanj commented on June 9, 2024

from homebridge-smart-irrigation.

VocalOverdub avatar VocalOverdub commented on June 9, 2024

I have the same issue.

Running on macOS (arm64)

Node v 15.14.0
NPM v 7.7.6

[2/3/2022, 7:51:10 PM] ====================
[2/3/2022, 7:51:10 PM] ERROR LOADING PLUGIN homebridge-smart-irrigation:
[2/3/2022, 7:51:10 PM] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js
require() of ES modules is not supported.
require() of /Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js from /Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/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 /Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/node_modules/got/package.json.

at new NodeError (node:internal/errors:329:5)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1109:13)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/js/.nvm/versions/node/v15.14.0/lib/node_modules/homebridge-smart-irrigation/index.js:9:13)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)

[2/3/2022, 7:51:10 PM] ====================

from homebridge-smart-irrigation.

jmaferreira avatar jmaferreira commented on June 9, 2024

Same problem here:

  • Node.js Version v16.13.2
  • Npm Version v8.1.2

Log message:

[05/02/2022, 14:01:58] ====================
[05/02/2022, 14:01:58] ERROR LOADING PLUGIN homebridge-smart-irrigation:
[05/02/2022, 14:01:58] Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js from /usr/local/lib/node_modules/homebridge-smart-irrigation/index.js not supported.
Instead change the require of /usr/local/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js in /usr/local/lib/node_modules/homebridge-smart-irrigation/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-smart-irrigation/index.js:9:13)
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:135:108)
    at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/lib/pluginManager.js:64:30)
    at async Server.start (/usr/local/lib/node_modules/homebridge/lib/server.js:106:9)
[05/02/2022, 14:01:58] ====================

from homebridge-smart-irrigation.

ddalbroi avatar ddalbroi commented on June 9, 2024

hey guys.. I'm not much of a coder but found what the issue is.. the plugin (when installed recently) is downloading version 12 of 'got' module which appears to be incompatible and hence throws the ES Module error. I managed to get the plugin working again by manually getting version 11.8.3 of 'got' and overwriting the files in .../homebridge-smart-irrigation/node_modules/got/ with the older version.

This is not a permanent fix - just a workaround...

from homebridge-smart-irrigation.

VocalOverdub avatar VocalOverdub commented on June 9, 2024

hey guys.. I'm not much of a coder but found what the issue is.. the plugin (when installed recently) is downloading version 12 of 'got' module which appears to be incompatible and hence throws the ES Module error. I managed to get the plugin working again by manually getting version 11.8.3 of 'got' and overwriting the files in .../homebridge-smart-irrigation/node_modules/got/ with the older version.

This is not a permanent fix - just a workaround...

Thanks for the tip. I tried this, but am still getting the same error :(

from homebridge-smart-irrigation.

jmaferreira avatar jmaferreira commented on June 9, 2024

It worked well for me. You need to go the ".../homebridge-smart-irrigation/node_modules/" folder and remove the existing got version and install the older one:

npm uninstall got
npm install [email protected]

from homebridge-smart-irrigation.

VocalOverdub avatar VocalOverdub commented on June 9, 2024

It worked well for me. You need to go the ".../homebridge-smart-irrigation/node_modules/" folder and remove the existing got version and install the older one:

npm uninstall got
npm install [email protected]

I had run the uninstall and the 11.8.3 install, but had not first deleted the files under homebridge-smart-irrigation.

Doing that first and re-running those commands did the trick.

Thank you both very much!

from homebridge-smart-irrigation.

matbe81 avatar matbe81 commented on June 9, 2024

Same issue.

Trying uninstalling & reinstallating got without success=

AM] ==================== [2/17/2022, 12:28:21 AM] ERROR LOADING PLUGIN homebridge-smart-irrigation: [2/17/2022, 12:28:21 AM] Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js from /usr/lib/node_modules/homebridge-smart-irrigation/index.js not supported. Instead change the require of /usr/lib/node_modules/homebridge-smart-irrigation/node_modules/got/dist/source/index.js in /usr/lib/node_modules/homebridge-smart-irrigation/index.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/usr/lib/node_modules/homebridge-smart-irrigation/index.js:9:13) at Plugin.load (/usr/lib/node_modules/homebridge/lib/plugin.js:135:108) at PluginManager.initializeInstalledPlugins (/usr/lib/node_modules/homebridge/lib/pluginManager.js:64:30) at async Server.start (/usr/lib/node_modules/homebridge/lib/server.js:106:9) [2/17/2022, 12:28:21 AM] ====================

from homebridge-smart-irrigation.

angyalz avatar angyalz commented on June 9, 2024

@MTry I think problem solved, but needs some check (but it works for me without error messages or warnings). See pull requests!

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024

@MTry I think problem solved, but needs some check (but it works for me without error messages or warnings). See pull requests!

@angyalz - Thank you for your effort and time!! I've been caught with stuff that has prevented me from contributing.

Could there be more feedback on this so I can go ahead and merge?

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024

from homebridge-smart-irrigation.

angyalz avatar angyalz commented on June 9, 2024

@MTry I tested with got v12.0.3, but I think I forgot update it in pushed branch.

The current (updated and published) version seems working for me.

from homebridge-smart-irrigation.

MTry avatar MTry commented on June 9, 2024

I suppose this has been addressed - closing.

from homebridge-smart-irrigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.