Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.21k forks source link

Issue "@azure/web-pubsub": "^1.1.3", #31573

Open tusharsurjuse opened 3 weeks ago

tusharsurjuse commented 3 weeks ago

An error occurred: TypeError: Right-hand side of 'instanceof' is not an object at push.66071.module.exports [as sign] (sign.js:114:57) at Object.sendRequest (webPubSubCredentialPolicy.js:17:33) at pipeline.js:51:31 at generatedClient.js:65:24 at Generator.next () at asyncGeneratorStep (asyncToGenerator.js:3:1) at _next (asyncToGenerator.js:17:1) at asyncToGenerator.js:22:1 at new ZoneAwarePromise (zone.js:2702:25) at asyncToGenerator.js:14:1

jeremymeng commented 3 weeks ago

@tusharsurjuse thanks for reporting the issue. If possible could you please share a simplified project that reproduces this?

It looks like the error is thrown from jsonwebtoken.sign, where it expects KeyObject from crypto. Are you running your app in an environment other than NodeJS?

https://github.com/auth0/node-jsonwebtoken/blob/bc28861f1fa981ed9c009e29c044a19760a0b128/sign.js#L114