TypeError: parsed is null when using webAuth checkSession

Hi all, I am trying to use webAuth.checkSession to get the token in order to use the User Management apis from auth0 js. So far I am getting “TypeError: parsed is null”. Here is my code below:

const webAuth = new WebAuth({
    domain: config.domain,
    clientID: config.manageId,
    audience: config.audience,
    scope: 'read:current_user',
    responseType: 'token id_token',
      audience: config.audience,
      scope: 'read:current_user',
    }, function(err, result) {
      token = result.accessToken;

This is how the documentation tells you how to get the token, but this is not working for me. Any clues anyone?