You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the JWT Helper from @mux/mux-node in the Bun runtime, the following error occurs:
10 | throw new TypeError(`${types.join(' or ')} instances for symmetric algorithms must be of type "secret"`);
11 | }
12 | };
13 | const asymmetricTypeCheck = (alg, key, usage) => {
14 | if (!isKeyLike(key)) {
15 | throw new TypeError(invalidKeyInput(alg, key, ...types));
^
TypeError: Key for the RS256 algorithm must be of type CryptoKey. Received an instance of KeyObject
at asymmetricTypeCheck (/Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/lib/check_key_type.js:15:15)
at checkKeyType (/Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/lib/check_key_type.js:42:9)
at /Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/jws/flattened/sign.js:52:9
at sign (/Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/jws/flattened/sign.js:29:16)
at /Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/jws/compact/sign.js:11:43
at sign (/Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/jws/compact/sign.js:10:16)
at sign (/Users/nzws/ghq/github.com/nzws/mux-node-sdk-bun-problem-repro/node_modules/jose/dist/browser/jwt/sign.js:10:16)
Running the same code in Node.js works without any issues. It seems that this error is due to jose using the build for browser environment when running in the Bun runtime, but the exact details are unclear.
When using the JWT Helper from
@mux/mux-node
in the Bun runtime, the following error occurs:Running the same code in Node.js works without any issues. It seems that this error is due to jose using the build for browser environment when running in the Bun runtime, but the exact details are unclear.
Here is the repository to reproduce this issue: https://github.com/nzws/mux-node-sdk-bun-problem-repro
Environment
The text was updated successfully, but these errors were encountered: