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

Get access token method throwing exception #124

Open
satheeshwaran opened this issue Sep 24, 2017 · 2 comments
Open

Get access token method throwing exception #124

satheeshwaran opened this issue Sep 24, 2017 · 2 comments

Comments

@satheeshwaran
Copy link

satheeshwaran commented Sep 24, 2017

I am getting the below exception

TypeError: Cannot read property 'name' of null
    at FormData._getContentDisposition (/user_code/node_modules/fb/node_modules/form-data/lib/form_data.js:226:39)
    at FormData._multiPartHeader (/user_code/node_modules/fb/node_modules/form-data/lib/form_data.js:177:33)
    at FormData.append (/user_code/node_modules/fb/node_modules/form-data/lib/form_data.js:70:21)
    at appendFormValue (/user_code/node_modules/fb/node_modules/request/request.js:323:21)
    at Request.init (/user_code/node_modules/fb/node_modules/request/request.js:334:11)
    at new Request (/user_code/node_modules/fb/node_modules/request/request.js:128:8)
    at request (/user_code/node_modules/fb/node_modules/request/index.js:53:10)
    at Facebook.value (/user_code/node_modules/fb/lib/fb.js:479:26)
    at Facebook.value (/user_code/node_modules/fb/lib/fb.js:399:22)
    at Facebook.api (/user_code/node_modules/fb/lib/fb.js:276:16)

on doing this,


FB.api('oauth/access_token', {
    client_id: 'app_id',
    client_secret: 'app_secret',
    grant_type: 'client_credentials'
}, function (res) {
    if(!res || res.error) {
        console.log(!res ? 'error occurred' : res.error);
        return;
    }
 
    var accessToken = res.access_token;
});
@dantman
Copy link

dantman commented Sep 24, 2017

@satheeshwaran This repository is obsolete. Please try upgrading to the current version of the library which is now at: https://github.com/node-facebook/facebook-node-sdk

@satheeshwaran
Copy link
Author

@dantman Thanks for the quick reply but the code seems to be the same. Don't know what is wrong.

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

2 participants