Comments (7)
If I quickly run multiple requests (api.registerUser
, +5 times) I'm running into the same issue as described in this StackOverflow question and the Uncaught TypeError: self.req.abort is not a function
error shows up too. Any chance node-hue-api
is not consuming the data as explained in the answer?
from node-hue-api.
I switched to nw.js and I'm running into the exact same problem...
from node-hue-api.
Why are you trying to register a user so many times?
I have not had a chance to look into the register user code, but it does look like that the connections are not being closed out. I will put together a set of tests for this to check if this is actually an issue on my side. Where is the error actually coming from, do you have a point in the code? It looks like it may be coming from within the request library, not mine.
As for upping the limit, you can set that directly yourself, and the http.globalAgent.maxSocket
is a global.
from node-hue-api.
I'm executing registerUser at an interval since I was having trouble reaching my hub within 30 seconds. I'm not trying to register a user multiple times a second, I'm just retrying after a set amount of seconds (5 seconds currently)/
What you're saying is probably correct though, the amount of requests exceeds a certain number (which is somehow set it while using it through Electron/NW, because it seems to work correctly in a browser). I stated the point in the code in my original post: node_modules/request/request.js:1340
.
I'll try and play with the max socket limit.
from node-hue-api.
@peter-murray, I've been trying and testing a lot and I came up with the following script (which gets combined with node-hue-api
via browserify
) that throws the Uncaught TypeError: self.req.abort is not a function
error when run through Electron/NW.js but successfully logs the resulting configuration object when run in a browser.
var hue = require('node-hue-api'),
api = new hue.HueApi('192.168.x.x', 'xxx');
api.config().then(function(result) {
console.log(result);
}).done();
from node-hue-api.
I have just created a 2.0.0-RC1
release of the library that now uses a different http request library, axios.
Can you try to use that and see if that clears up the problems you are experiencing? Also can you confirm if you are still converting this library using browserify?
Thanks
from node-hue-api.
@peter-murray, you are an absolute hero! I updated to 2.0.0-RC1 and that finally resolved the problems I was having.
Probably unrelated now but yes I am still using your library in combination with browserify
.
from node-hue-api.
Related Issues (20)
- Error when using Webpack / Electron HOT 1
- Example typo
- Touchlink activation HOT 1
- Cant get this to work with React.JS HOT 2
- Export as esm module HOT 20
- mDNS Discovery HOT 4
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 15
- Cannot import createLocal using TypeScript HOT 3
- Example doesn't work HOT 2
- api.sensors.updateSensorConfig not working due to un-settable params included in request HOT 3
- Failed to create sensor from bridge model: Error: Unknown type 'zllrelativerotary' to create Bridge Model Object HOT 3
- MDNS Discovery not working (Empty Array) HOT 12
- Implement RGB support for groups HOT 1
- Hue API V2
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 1
- bridge-validation.ts is missing bridgeid
- setLightState sets bri to 1 [esmodules] HOT 1
- Cannot be used in browser due to a minor issue
- Please make Rate Limiting configurable HOT 3
- Getting Value, '65520' is not within allowed limits: min=-255 max=255 for 'id' when using Philips Hue-Bridge adapter in iobroker
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 node-hue-api.