Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Report when trying to createAccessToken #240

Open
eggers opened this issue Dec 15, 2022 · 2 comments
Open

Crash Report when trying to createAccessToken #240

eggers opened this issue Dec 15, 2022 · 2 comments

Comments

@eggers
Copy link

eggers commented Dec 15, 2022

Which SDK version are you using?

14.0.0

What's the issue?

Trying to create a new access token results in a crash report.

Steps/Sample code to reproduce the issue

import * as bizSdk from 'facebook-nodejs-business-sdk';

export async function getNewToken({
  access_token,
  appId,
}: {
  access_token: string;
  appId: string;
}) {
  bizSdk.FacebookAdsApi.init(access_token);
  const business = new bizSdk.Business(appId);
  const fields: string[] = [];
  const params = {
    app_id: appId,
    scope: 'ads_read',
  };
  return business.createAccessToken(fields, params);
}

Observed Results:

CrashReporter: SDK crash detected!
active uncaughtException : 1011993879553609
Successfully sent crash report.
Unhandled rejection Error
    at FacebookRequestError.FacebookError [as constructor] (.../node_modules/facebook-nodejs-business-sdk/dist/exceptions.js:18:16)
    at new FacebookRequestError (.../node_modules/facebook-nodejs-business-sdk/dist/cjs.js:373:129)
    at .../node_modules/facebook-nodejs-business-sdk/dist/api.js:148:15
    at tryCatcher (.../node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (.../node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (.../node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (.../node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (.../node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (.../node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (.../node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (.../node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (.../node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:471:21)

Expected Results:

  • What did you expect to happen?
    A new token should be generated which can be used to fetch ad information.
@eggers
Copy link
Author

eggers commented Dec 15, 2022

I also tried updating to v15 and got the same error.

@eggers
Copy link
Author

eggers commented Jan 11, 2023

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant