.getProduct() is not a function

ok after some playing around ive found getProduct fails when the page is first opened/refreshed. if you navigate to another product and back it starts working.