affiliate icon indicating copy to clipboard operation
affiliate copied to clipboard

[Affiliate] TypeError: e.set is not a function

Open elvismdev opened this issue 2 years ago • 2 comments

Hi @russellsteadman,

I'm implementing now Affiliate and AffiliatePluginAmazon with the intention to use the new aff.convert() method, added in v5 after our last thread here: https://github.com/russellsteadman/affiliate/issues/31#issuecomment-1374914260

However, as I'm putting it all together in my React app, I noticed it is throwing me out an error in the console when the aff.convert() method is called.

2023-02-12_17-09

I'm adding below parts of the relevant Affiliate and AffiliatePluginAmazon code for a greater context of what I have running over here that produce this error.


// ...

import Affiliate from "affiliate";
import AffiliatePluginAmazon from "affiliate-plugin-amazon";

// ...

const amazonAff = AffiliatePluginAmazon(Affiliate, {
    tags: {
      us: "amzapplink-20", // for USA, required
      gb: "", // for UK
      de: "", // for Germany
      fr: "", // for France
      jp: "", // for Japan
      ca: "", // for Canada
      cn: "", // for China
      it: "", // for Italy
      es: "", // for Spain
      in: "", // for India
      br: "", // for Brazil
      mx: "", // for Mexico
    },
    debug: false, // verbose logging into the console, default off
    locale: null, // manually set the country code of the browser, default automatic
    modifyDomain: true, // modify domains like amazon.com to amazon.co.uk based on locale, default on
  });
  
// ...

// Testing convert function.
console.log(amazonAff.convert("https://www.amazon.com"));

elvismdev avatar Feb 13 '23 01:02 elvismdev