Open Matthew-John-Emerson opened 3 months ago
I'm seeing this as well. The error I get is "TypeError: Cannot destructure property 'request' of '(intermediate value)(intermediate value)(intermediate value)' as it is null."
It says it's occurring here https://github.com/intuit/oauth-jsclient/blob/master/src/OAuthClient.js#L319
Thanks @Matthew-John-Emerson and @bogeorget4 , could you please help with the steps to reproduce this error.
I run into this as well. I am able to see it when I connect to QBO, and then disconnect through the use of OAuthClient.revoke();
which responds with status 200 but there is no body on the JSON response. Thus, the disconnect is successful but it throws an error.
Hi, @rajeshgupta723 I have the same problem, I use intuit-oauth: 4.1.2.
I too am encountering this issue, on a DELETE request. 4.1.2
Hi, thank you all, will look into this. In the meantime, feel free to raise a PR for the fix.
This is what is logged when using the revoke
function:
Hi @amadeogallardo @vektorblake @stepanFederlian @Matthew-John-Emerson @crisebrough @bogeorget4 -- could you all please get the latest from the branch release-4.1.3 and test this out. Please confirm if the fix works for you. Thanks
Hi @rajeshgupta723 , I did try the release-4.1.3 and still got an issue.
The res
returns an empty body and a null json. It seems like the validation of the json is to make sure we get a valid response from the server.
I have attached a screen shot.
I have changed line 319 from
const authResponse = res.json ? res : null;
to
const authResponse = res.hasOwnProperty('json') ? res : null;
and the error ran away.
When I call
revoke
, I end up getting an error because it is trying to destructure the response JSON when the json is null. This happens even though the request to Intuit succeeds and the token is revoked. Also, it looks like the tests for revoke are also failing locally.