facebook-nodejs-business-sdk
facebook-nodejs-business-sdk copied to clipboard
Cannot read properties of undefined
Which SDK version are you using?
13.0.0
What's the issue?
The SDK causes a crash trying to read FacebookAdsApi.getDefaultApi().getAppID(). We do not set the api key via the init method as that was causing us issues with multiple clients. Instead we always pass each object a new API object. e.g. const adAccount = new AdAccount(adAccountId, undefined, undefined, api);
TypeError: Cannot read properties of undefined (reading 'getAppID')
at Object.processUncaughtException (/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:487:35)
at process.
Steps/Sample code to reproduce the issue
Observed Results:
- What happened? This could be a description, log output, etc.
CrashReporter: SDK crash detected!
/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:487
FacebookAdsApi.getDefaultApi().getAppID().then(function (data) {
^
TypeError: Cannot read properties of undefined (reading 'getAppID')
at Object.processUncaughtException (/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:487:35)
at process.<anonymous> (/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:464:30)
at process.emit (node:events:539:35)
at process.emit (node:domain:475:12)
at process._fatalException (node:internal/process/execution:167:25)
at processPromiseRejections (node:internal/process/promises:279:13)
at processTicksAndRejections (node:internal/process/task_queues:97:32)
Expected Results:
- What did you expect to happen? No error to be thrown
Hi @aaronhayes, did you end up finding out how to work around it?
@banuragaxioned could you confirm is this still an outstanding issue?