Lots of Console Errors all the time

Ill start off by saying, Im a total amateur developer and still finding my way, learning the better ways of doing things all the time. At this point Ive made a few daily driver apps for my company that work well. However I am extremely bothered by the amount of errors in the console output and they all suffer from this.

My apps tend have JSON data loaded into a Variable State, which make them very snappy and responsive, Probably 90% of my queries are calling variable.setIn() in some way or another for manipulating data.

I notice that each time a key is updated, even just a single nested key, (seems like) every single element that references the variable throws an error into the console, for the couple MS its being updated. My latest app throws possibly hundreds of error lines with a simple update to 1 key. Lots of elements and logic built off the variable overall.

This has been making debugging extremely painful as I have lot of scrolling in the console for backtracking purposes, with the size of my latest app now (200 queries) sometimes I cant even find what im looking for. Yes, I do realize I can hide the errors from displaying, but I am in the console to debug...

My question is, am I doing something wrong?
Is there a better way?

The errors that are showing up are not keeping the functions from completing, and my queries are completing as I would expect. It would be nice if these didn't over run the console, which leads me back to generally feeling like im doing something totally wrong.

This is an example, you get the point. The keys that 'cant be read' are all accessible other than for a very split second when being modified, causing so many errors

You probably have code like {{ query1.data.id }} or something like that. Using optional chaining may help: {{ query1.data?.id }}

2 Likes

This seems to be taking care of it. Thank you so much, Im glad it is just this simple!

2 Likes