I am getting this error on all of the pages except the HOMEPAGE, i am using a custom theme whose parent theme is LUMA.
In this case you will definitely accessing any node in html which is not present. so you have to place its presence check before calling it. wrap your code like following
Now question is how You can fins it it will present in above console error check ne by one lines and you will find that line definitely it will be your custom line, not magentos code.