google-api-nodejs-client icon indicating copy to clipboard operation
google-api-nodejs-client copied to clipboard

dfareporting fails with "ctr is not a constructor"

Open jd-andrews opened this issue 3 years ago • 1 comments

dfareporting v3.4 was sunset the a couple weeks ago and migrating to 3.5 hasn't been going smoothly.

doing this -

  const { google } = require("googleapis");
  
  this.dfareporting = google.dfareporting({
       version: "v3.5",
       auth: this.auth,
  })

results in - Error: Unable to load endpoint dfareporting("v3.5"): ctr is not a constructor at Object.getAPI (\node_modules\googleapis-common\build\src\apiIndex.js:36:15) at GoogleApis.dfareporting (\node_modules\googleapis\build\src\apis\dfareporting\index.js:24:32)

and when I try to revert to 3.4 -

  this.dfareporting = google.dfareporting({
       version: "v3.4",
       auth: this.auth,
  })

results in -

  403 DCM Service Error: 3140 : Version v3.4 of the DCM/DFA Trafficking and Reporting API is no longer supported. Please upgrade 
  to the latest version of the API.

So I'm not sure what to do, and also running $ npm install @googleapis/dfareporting doesn't update node_modules with v3.5.

jd-andrews avatar Jan 28 '22 19:01 jd-andrews

Hi @jd-andrews, just to make sure it's nothing obvious, would you mind running rm -rf node_modules and rm -rf package-lock.json, then reinstall the desired package?

sofisl avatar Jul 29 '22 13:07 sofisl