TypeError: $w(...).getProduct is not a function

I am brand new to any form of coding and i am getting
TypeError: $w(…).getProduct is not a function

the error line is
$w.onReady( async function () {
product = await $w(‘#Games’).getProduct();

This is on a custom made product page with the element of the page set to #Games

On top of this, I have set a button to add to a wishlist yet clicking the button does nothing. I am assuming this error is the cause of this as there are no other errors in the code.

If you search the forum before posting you would have found similar recent posts about this.

according to that forum the issue was fixed. Is this no longer the case?

According to previous forum posts you can see that Wix have said that it was supposedly fixed and should not happen again. However, it seems that you are getting it happening on your website.

I will bring it to the Wix teams attention again and hopefuly it will be sorted for you as well, however please give a day or two for it to be worked on.

Please post your Wix Editor link here so that if the Wix mods look at this post, they can look at your Editor and try to find the case for you.

It is only Wix Mods that can access your Wix Editor, nobody else has the permissions to do so.

Finally, thanks for letting us know that it is happening to you and cross fingers, it is fixed for you soon too. :crossed_fingers:

@givemeawhisky https://editor.wix.com/html/editor/web/renderer/edit/032570df-d43e-4428-9f5a-35989d5ac2a0?metaSiteId=9736d397-0604-4bd3-a527-f5912be5efb7&editorSessionId=1f171f35-d40e-44ae-8be6-22b3a81cee3a&referralInfo=my-account

There is my editor link, thank you

The main problem is that you are trying to call getProduct() on a page that is not a Product Page. See the Wix Stores articles for information on setting up an online Store and how to use the Stores API.

In your code you have two separate page onReady() functions. You should only have one.

Also, move the import statements to the beginning of your code.

See the Coding with Corvid docs for information on using Corvid.

Please refer to the Corvid Tutorial: Adding Ratings and Reviews to a Wix Stores Site for one example how to use Product Pages.

I have same issue and I am following the Corvid Tutorial with default product page.

Same issue here with default product page. All reference articles are also with the error and still continue to set an example to be followed.