Open hunterchainstarters opened 5 months ago
+1
@Electroid do you know if there is any discussion to tackle this bug in the upcoming releases? It is currently preventing my team from fully switching to Bun. Thanks :D
i see we've done several updates since this was discussed last (1.1.4 now it's on 1.1.15). any update on this bug?
@Electroid
No update right now. This is among a backlog of bugs we want to fix.
No update right now. This is among a backlog of bugs we want to fix.
Thanks for the response š
Encoding the strings as base64url
should help you get around it for now. The JSON Web Algorithms RFC (https://datatracker.ietf.org/doc/html/rfc7518) mandates the use of base64url
everywhere, but Node generally follows https://infra.spec.whatwg.org/#forgiving-base64-decode. Unfortunately, the relevant code path here for a lot of the crypto operations that involve some kind of base64 decoding go straight into the C++ backend, which does not support the mixed decoding approach at the moment, and instead always assumes you've given it a base64url
encoded string.
What version of Bun is running?
1.1.4
What platform is your computer?
Linux 6.5.0-28-generic x86_64 x86_64
What steps can reproduce the bug?
Below is a code snippet to reproduce the error:
What is the expected behavior?
The code snippet (example.ts) produces a key object in ts-node:
What do you see instead?
But, in bun I get this error:
Additional information
migrating to bun, if this is working :)
Edit: The below code snippet seems to work, changing base64 encodings to base64url