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

fbUser.getPicture - Cannot read properties of undefined (reading 'map') #237

Open
ryordanov opened this issue Nov 8, 2022 · 0 comments
Open

Comments

@ryordanov
Copy link

Which SDK version are you using?

15

What's the issue?

Crash in Node.js when trying to get the profile picture.

200 GET https://graph.facebook.com/v15.0/YYY/picture?access_token=XXX
Response: "����\u0000\u0010JFIF... ��⌂��"
CrashReporter: SDK crash detected!
Unhandled rejection TypeError: Cannot read properties of undefined (reading 'map')

Steps/Sample code to reproduce the issue

import fbBizSdk from 'facebook-nodejs-business-sdk';
const User = fbBizSdk.User;
const fbUser = new User(userID);
const pictures = await fbUser.getPicture();

Observed Results:

Unhandled rejection TypeError: Cannot read properties of undefined (reading 'map')
at Array.Cursor._this._buildObjectsFromResponse (...\node_modules\facebook-nodejs-business-sdk\dist\cjs.js:1504:28)

_this._buildObjectsFromResponse = function (response) {
return response.data.map(function (item) { -> response is the picture itself: "�����JFIF����...."
....
}

Expected Results:

  • What did you expect to happen?
    To receive user's picture.
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