Closed ingvevs closed 1 month ago
homey-api
(3.6.4, aka @latest
) explicitly declares node-fetch@2
as a dependency:
"dependencies": {
...
"node-fetch": "^2.6.7",
...
}
A test script also seems to work fine for me.
@robertklep yes that's very strange, I verified it with a test app as well. I can't figure out why it's complaining. Perhaps it's my nextjs app setup. But then again, I see only references to @2 version of node-fetch. Closing the issue.
When trying to create local api in node,
homey.HomeyAPIV3Local.createLocalAPI
, the following error message is thrown:Uncaught Error: fetch is not a function at Util.fetch (<...>.node_modules/homey-api/lib/Util.js:43:25)
. The node-fetch package is now an ESM-package only, thus the current require usage of it is now working any more.https://www.npmjs.com/package/node-fetch#loading-and-configuring-the-module