getCachedState() returns null, failing the requests
See original GitHub issueThe below code fails for me with
Cannot read property 'modelid' of null
so it’s clear that the getCachedState()
function returns null
in my case.
This was at the very first setup. I don’t know which exact situation is needed to reproduce this, but I got this error as soon as the Hue API started working for me for the first time.
I hope this is enough indication for you to find the bug in the code. null errors should be simple enough to fix.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
next-auth get request issue returns null - Stack Overflow
i'm having a problem when i request GET to my api it returns me unauthenticated even though im logged in. my api code...
Read more >Request.form returns null value on live site but it gives ... - MSDN
this code is working fine on localhost but on live server Request.Form returns Null value my sample code is here kindly tell me...
Read more >Handling a Null Response from an API
An API that returns a null response can result in some really strange errors. Learn how to handle a null in Fetch and...
Read more >Null API Responses and HTTP 204 Results in ASP.NET Core
ASP.NET Core 3.x has a behavior that results in API results that return null from the controller action returning a HTTP 204 -...
Read more >c# - What's wrong with returning null?
I often see code which fails with NPE when it checks something.isEmpty() , thinking that something is an Optional. And then you get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have recent Hue bridge, IIRC late 2018. I think that’s version 2.
FYI, when I tested, it was blowing up only at this one spot. With the hacky patch, it worked as expected. I could enumerate lights and rooms, and switch them on and off. However, it’s possible that this does unnecessary work on startup.
I perfectly understand the need to test the fixes. If you need me to test something specific with master, I can do that. However, I’m currently only vacation, and otherwise have to run 2 companies, so I cannot guarantee it.
Re: axing axios (pun intended): Yay! Thanks!
(replying by email)
Am 17. August 2020 10:12:23 MESZ schrieb Peter Murray notifications@github.com:
– Sent from my cell phone. Please excuse the brevity.
Your fix that you suggest just pushes problems further down and other stuff will blow up later in use (I cannot see how we don’t get a cache loaded). The cache is a requirement to load the known configuration and to store things like the lights that are known so that various validations can be performed later, getting past this current check just stores up later failures that will happen if you call certain functions in the API.
This ticket was closed as I provided some changes to get feedback to narrow down as to the problem at hand. There was no response from that and those changes added that I asked for feedback on.
If I cannot reproduce an issue, I cannot test it. If I cannot reproduce and test it, I cannot release a fix to it that I am confident in it not impacting other users.
Signify has ended software updates for the v1 of the bridge, so the need for this check is goign to go away as people retire the older bridges, removing the divergence in the API parameters.
I am currently working on a
5.0
release of the library which is removing axios for a fetch based implementation (to better support browser use cases and remove some of the bloat and proxy support issues of axios).