InteractiveAdvertisingBureau / iabtcf

Apache License 2.0
14 stars 19 forks source link

Uncaught (in promise) GVLError: Cannot read property 'purposes' of null #14

Closed adityamishraofficial closed 4 years ago

adityamishraofficial commented 4 years ago

I am getting an error while passing vendor list ( GVLError: Cannot read property 'purposes' of null )

 GVL.baseUrl = 'http://localhost:3000/vendorlist.json';
    const tcModel = new TCModel(new GVL());
    tcModel.gvl.readyPromise.then(() => {
        const encodedString = TCString.encode(tcModel);
        console.log(encodedString); // TC string encoded begins with 'C'
    });
chrispaterson commented 4 years ago

Change GVL.baseUrl = 'http://localhost:3000/vendorlist.json';

To

GVL.baseUrl = 'http://localhost:3000/';

Rename vendorlist.json to vendor-list.json Or set ‘GVL.latestFilename = ‘vendorlist.json’

adityamishraofficial commented 4 years ago

thanks man ...