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

Trying to run one of the basic SDK examples results in SDK crash #271

Closed
jobiewong opened this issue Jan 29, 2024 · 1 comment
Closed

Trying to run one of the basic SDK examples results in SDK crash #271

jobiewong opened this issue Jan 29, 2024 · 1 comment

Comments

@jobiewong
Copy link

Which SDK version are you using?

v19.0.0

What's the issue?

Running the minimum example setup as provided in the /examples/ad_account_node.js results in the error message:
CrashReporter: SDK crash detected!
Not be able to find appID, fail to send report to server.

Steps/Sample code to reproduce the issue

Run a .js file with the code given in the example

const bizSdk = require('facebook-nodejs-business-sdk');
const AdAccount = bizSdk.AdAccount

const access_token = {META_ACCESS_TOKEN};
const app_secret ={META_APP_SECRET};
const app_id = {META_APP_ID};
const id = "act_" + {META_ACCOUNT_ID};
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
  api.setDebug(true);
}

const logApiCallResult = (apiCallName, data) => {
  console.log(apiCallName);
  if (showDebugingInfo) {
    console.log("Data:" + JSON.stringify(data));
  }
};

const fields = ["name"];
const params = {};
const sample_code = new AdAccount(id).get(fields, params);
logApiCallResult("sample_code api call complete.", sample_code);

Observed Results:

The console repeatedly prints the following error:

CrashReporter: SDK crash detected!
Not be able to find appID, fail to send report to server.

Expected Results:

The name of the account linked with the provided account_id should be printed.

@jobiewong
Copy link
Author

jobiewong commented Jan 29, 2024

Unless I am missing something very obvious, there appears to be no actual reference to the app_id after it is defined in any of the code examples. In the Javascript SDK the api is initialised with the app_id and app_secret but this doesn't appear to be the case in the NodeJs SDK.

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