nylas / nylas-nodejs

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
MIT License
167 stars 117 forks source link

Uncaught (in promise) Error: No access token in response #496

Closed elcous closed 9 months ago

elcous commented 10 months ago

Describe the bug Error occurs when using this module in Deno environment

To Reproduce Some steps involved to reproduce the bug and any code samples you can share.

import Nylas from "npm:nylas";

Nylas.config({
  clientId: Deno.env.get("CLIENT_ID"),
  clientSecret: Deno.env.get("CLIENT_SECRET"),
});

async function test() {
  const code = "123";

  Nylas.exchangeCodeForToken(code).then((token) => {
    console.log(token);
  });
}

Expected behavior Error shouldn't occur

SDK Version: 6.10

Additional context Most likely happens because of the bug here: https://github.com/node-fetch/node-fetch/issues/1725

That was fixed. Probably can just upgrade node-fetch version to >2.6.12

mrashed-dev commented 9 months ago

Thanks for opening this issue @elcous, just upgraded and the tests pass. Looks like we're good to upgrade!