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

Right-hand side of 'instanceof' is not an object for token.toJwt() (next.js) #1015

Open
MarkovskiyKonstantin opened this issue Apr 4, 2024 · 1 comment
Labels
status: waiting for feedback waiting for feedback from the submitter

Comments

@MarkovskiyKonstantin
Copy link

Issue Summary

When I create an access token and add it to jwt I get a error Right-hand side of 'instanceof' is not an object for next.js app
image

Steps to Reproduce

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

Code Snippet

    const AccessToken = Twilio.jwt.AccessToken;

    const VoiceGrant = AccessToken.VoiceGrant;
    
    const token = new AccessToken(accountSid, apiKey, apiKeySecret, {identity});

    const voiceGrant = new VoiceGrant({
      incomingAllow: true, // Optional: add to allow incoming calls
      outgoingApplicationSid: accountSid,
    });

   token.addGrant(voiceGrant);

    console.log('### token', token.toJwt());

    

Technical details:

"twilio": "4.23.0",
node version: v20.9.0
"next": "13.3.2",

@tiwarishubham635
Copy link
Contributor

I think this is an open issue with jsonwebtoken v9, see here. A quick fix can be that we can revert the version from 9.0.0 to 8.5.1 but the permanent fix will be done by this library only. So it is more of an issue for that repository.

@tiwarishubham635 tiwarishubham635 added the status: waiting for feedback waiting for feedback from the submitter label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter
Projects
None yet
Development

No branches or pull requests

2 participants