Closed privatesam closed 1 year ago
Got the error in the back terminal:
TypeError: Cannot read properties of null (reading 'formattedAddressLines')
at /Users/eret/AirtagsAnywhere/back_airtags/index.js:19:50
at Array.map (<anonymous>)
at /Users/eret/AirtagsAnywhere/back_airtags/index.js:15:14
at Layer.handle [as handle_request] (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/route.js:144:13)
at Route.dispatch (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/route.js:114:3)
at Layer.handle [as handle_request] (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/layer.js:95:5)
at /Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/index.js:286:22
at Function.process_params (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/index.js:348:12)
at next (/Users/eret/AirtagsAnywhere/back_airtags/node_modules/express/lib/router/index.js:280:10)
By Cannot read properties of null (reading 'formattedAddressLines')
I suspect AirtagsAnywhere is erroring because of a null address being returned from the Items.data file? I do have some tags and devices which have 'no location' at the moment I wonder if thats causing the error? I guess I can take a look at adding a check for a null location
but I've not familiar with node.
The project is kind of deprecated since I don't have a macbook to test and maintain it.
I can do a commit with some fixes, but I don't like the idea of not testing the code first.
I can confirm that there is no verification of the information available, maybe try to update the location using an iPhone or macbook before re-running it.
Can you try the develop branch? a PR would be welcome if you can fix details that I haven't fixed myself
OK I manually edited the Items.data file and updated the address for the tag that has no battery and then ran AirtagsAnywhere and it works. I think I'll just pop new batteries in my Airtags to solve this problem. I did take a look at the code and think the index.js from the backend with this particular line address: appleDevice.address.formattedAddressLines.join(", "),
needs amending to do a check for null
. I might take a look at some point and submit something but need to do a bit of reading on typescript and ternary operators. Thanks for reply anyway.
The issue must be fixed in the develop branch, any success with this branch without editing your Items.data ? Editing Items.data is not reliable since FindMy app will overwrite it
I just put a new battery in the airtag that was causing the 'no location' problem in the Items.data file. I noticed that FindMy didn't actually overwrite the manual edit to Items.data until it had an actual newly reported location so it is a nasty workaround.
Hi. Thanks for this interesting app. I've installed in a VM of BigSur and everything went to plan but after npm start and going to the page I just get a blank page. Its titled with AirtagsAnywhere so the node server is working and responding its just not showing anything - what debug info can I provide to help troubleshoot?