Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Crypto - KeyObject is undefined for Node V14 - "jsonwebtoken": "9.0.0"

Aperta
#885 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
backend

Direzione di ricerca

Riproduci il malfunzionamento con jsonwebtoken 9.0.0 su Node v14.10.1 usando l'esempio di jwt.sign. Inizia in sign.js, nel controllo di KeyObject vicino alla riga segnalata, e considera il problema risolto quando la stessa chiamata di firma non genera più un TypeError su quella versione di Node.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description
KeyObject from Crypto is undefined. I am using Node 14.10.1. 
Reproduction

NODE v14.10.1
jwt.sign({email: "bar@foo"}, "PRIVATE_KEY", { algorithm: 'HS512' })

Throws an error
webpack-internal:///…ebtoken/sign.js:173 Uncaught (in promise) TypeError: Right-hand side of 'instanceof' is not an object
at module.exports [as sign] (sign.js:108:1)
if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) {

image
Environment

Please provide the following:

  • Version of this library used: 9.0.0
  • Version of the platform or framework used, if applicable: any platform
  • Other relevant versions (language, server software, OS, browser):
  • Other modules/plugins/libraries that might be involved:
Lingua principale
JavaScript
Stelle
18.2k
Fork
1.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di auth0/node-jsonwebtoken

Tutte le issue di auth0/node-jsonwebtoken

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.