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

TypeError: Right-hand side of 'instanceof' is not an object #18

Open
DeepKumbhare85 opened this issue Apr 4, 2023 · 2 comments
Open

Comments

@DeepKumbhare85
Copy link

system: macos
browser: chrome
jsonwebtoken-esm: "^2.0.1"

Hello,
I am trying to integrate jsonwebtoken-esm package in my vue+vite project, but I am facing several issues regarding the import of sign and verify methods.

Here's how I am importing them:

import { sign, verify } from 'jsonwebtoken-esm';
let token;
const secret = 'my-secret'
const createToken = () => {
  console.log('hello')
  token = sign({ name: "deep" }, secret, { expiresIn: '10s' })
  console.log(token);
}

running this gives me error like TypeError: Right-hand side of 'instanceof' is not an object

Steps to reproduce

1 ) Click here and clone GitHub repo.
2 ) Run the project using npm run dev and open the dev server in a browser. make sure to open the console.
3) Click on the create Token button and you will see the error.

Note: This error starts from version 2.0.0. packages below this version work fine.

~Regards

@rotsee
Copy link

rotsee commented Apr 17, 2023

This error persists in version 2.0.1.

@ylq5126
Copy link

ylq5126 commented Jul 13, 2023

This error persists in version jsonwebtoken-esm-fix 9.0.0

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

3 participants