Comments (20)
Please check now - have merged the changes and this should be working now.
from homebridge-smart-irrigation.
Yes.. I bumped the got version as well..
from homebridge-smart-irrigation.
Hi Shane.. just wanted to let you know that I'm trying to replicate this however without success so far.
from homebridge-smart-irrigation.
from homebridge-smart-irrigation.
from homebridge-smart-irrigation.
Same issue here.
Node: v16.13.2
HomeBridge: v1.4.0
from homebridge-smart-irrigation.
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.
from homebridge-smart-irrigation.
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.
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.
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.
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.
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.
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.
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.
@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 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.
from homebridge-smart-irrigation.
@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.
I suppose this has been addressed - closing.
from homebridge-smart-irrigation.
Related Issues (20)
- Error send email HOT 5
- Assistance in setting up HOT 24
- Always receiving "Error: Email not sent - recheck email settings. Moving ahead..." HOT 5
- [FEATURE REQUEST] A scheduling 2 times of watering per day HOT 6
- [BUG] Pushover stops sending push notification since the latest update. HOT 2
- Help or Questions HOT 2
- Not an Issue, but a question ... HOT 5
- Issue With Setup HOT 3
- Docker related - Standing reboot - Fixed v1.7.1 HOT 30
- Help or Questions HOT 11
- Help or Questions HOT 3
- [BUG] HOT 13
- [FEATURE REQUEST] - Delay Between Zones and Cycles HOT 2
- Choosing hour of irrigation HOT 3
- "Nozzle type" setting etc. HOT 1
- [BUG] HOT 2
- Timer Not Working HOT 5
- Request for new features HOT 1
- API Error - 401 Unauthorised HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-smart-irrigation.