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
If you happen to have jose as a transitive dependency from a module which Bun resolves using its Node.js compatibility layer it is very likely it's not going to work for now. There are multiple issues at hand which the @oven-sh team is attempting to solve to get this to work seamlessly.
When and if Bun finishes its node:crypto compatibility fully it will be possible for the "bun" target in jose's package.json to be pointed to the node.js build. Doing so now only peels off a layer of errors only to immediately fail on crypto.sign, crypto.verify, crypto.diffieHellman, and possibly other, missing APIs.
jose is a universal module, but the way it is used in some projects may be runtime-specific.
Tip
If you use jose directly in your code executed in Bun, then you're all set and good.
Warning
If you happen to have
jose
as a transitive dependency from a module which Bun resolves using its Node.js compatibility layer it is very likely it's not going to work for now. There are multiple issues at hand which the @oven-sh team is attempting to solve to get this to work seamlessly.When and if Bun finishes its
node:crypto
compatibility fully it will be possible for the "bun" target in jose's package.json to be pointed to the node.js build. Doing so now only peels off a layer of errors only to immediately fail on crypto.sign, crypto.verify, crypto.diffieHellman, and possibly other, missing APIs.jose
is a universal module, but the way it is used in some projects may be runtime-specific.Tip
If you use
jose
directly in your code executed in Bun, then you're all set and good.Bun makes use of Web Cryptography API for the cryptographic operations.
JSON Web Key Type Support
kty
valueJWS Algorithm Support
alg
valuesJWE Key Management Algorithm Support
alg
valuesJWE Content Encryption Algorithm Support
enc
valuesUnsupported Algorithms or Key Types
Due to the Web Cryptography API and runtime limitations the following is not supported in Bun:
See also
The text was updated successfully, but these errors were encountered: