who-owns-what
who-owns-what copied to clipboard
Occasional "Invalid LngLat object: (NaN, NaN)" error on client
In the tracebacks, it looks like this is coming from Mapbox GL and/or its React wrapper, but I'm not sure what's going on, and I'm having trouble reproducing the error.
@sraby, I think I recall you mentioning this error a long time ago, do you have any insight?
@toolness does this have anything to do with https://github.com/JustFixNYC/who-owns-what/issues/230?
Ah possibly! The weird thing, though, is that as far as I can tell, I can't reproduce the error... If the problem was because the lat/long info isn't in PLUTO, it seems like the error would be easy to reproduce, right?
Ahhh I think I know what's going on! I think that specific error comes up when a user clicks on a "View Detail" button on the Portfolio tab for a building without lat/lng coordinates. Try this example: https://demo-whoownswhat.herokuapp.com/en/address/QUEENS/10319/68TH%20ROAD
If you go to the Portfolio tab and click on View Detail for 55 WEST 46TH STREET, you should get a Invalid LngLat object: (NaN, NaN)
error logged in the console.
Ok so given our recent refactorings, it seems like this error is no longer recreatable and not being logged in RollBar anymore! You can check out both pathways to the error:
- https://demo-whoownswhat.justfix.nyc/en/address/BROOKLYN/2/GRACE%20COURT/portfolio — click on "View Detail" for 20 Confucious Plaza (which has no lat/lng) here goes back to the map and just deselects all the points. Great! 2 https://demo-whoownswhat.justfix.nyc/en/address/MANHATTAN/20/CONFUCIUS%20PLAZA — here, the search address has no lat/lng but the page still shows up, just with no point on the map selected. Also great!
Err, it seems to still be happening though? According to Rollbar, it's been happening for visits to some pages on the latest version of our codebase, although I can't reproduce it when I visit those URLs and click on every building in the portfolio... Still, since it appears to still be happening I'm gonna reopen this issue for now.