Why is my "add to cart" button not working?

Hello everyone, could someone help me with my VELO code, please? I have a dynamic page linked to products, and I would like to add an “add to cart” button. Despite reaching out to Wix support, my code still isn’t working, and I’m getting an error message. Please help me!

my code :

import { myAddToCurrentCartFunction } from "backend/befsovaz.web"; // Importe ta fonction backend
import wixLocation from 'wix-location'; 

$w.onReady(function () {
  let dynamicDataset = $w("#dynamicDataset"); 

  dynamicDataset.onReady(() => {
    const currentProductId = dynamicDataset.getCurrentItem()._id; 
    const appId = "215238eb-22a5-4c36-9e7b-e7c08025e04e"; 
    const variantId = dynamicDataset.getCurrentItem().variantId; 

    const options = {
      lineItems: [
        {
          catalogReference: {
            appId: appId,
            catalogItemId: currentProductId, 
            options: {
              variantId: variantId || null, 
            },
          },
          quantity: 1,
        },
      ],
    };

    $w("#button9").onClick(() => {
      myAddToCurrentCartFunction(options)
        .then((updatedCart) => {
          console.log("Produit ajouté au panier !", updatedCart);
          wixLocation.to("/cart-page");
        })
        .catch((error) => {
          console.error("Erreur lors de l'ajout au panier :", error);
        });
    });
  });
});