You can see more about working with the html element here.
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://www.wix.com/corvid/reference/$w.HtmlComponent.html
Also, take a look at this example here.
https://support.wix.com/en/article/corvid-tutorial-adding-ratings-and-reviews-to-a-wix-stores-site
Try it as the example shows first and see if it just runs with product.
import wixData from 'wix-data';
import wixWindow from 'wix-window';
let product;
$w.onReady(async function () {
product = await $w('#productPage1').getProduct();
Understanding the Code
Lines 1-2: Import the modules we need to work with Wix Data and Wix Window libraries.
Line 5: Define the global product variable.
Line 7: When the page loads, do the following:
Line 8: Using the getProduct function on the current product page, set the product variable to the currently displayed product.