-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import named 'diffieHellman' not found in module 'crypto' #6782
Comments
Using jose in Astro SSR (using Vite SSR modules). Bun version is 1.0.7 aswell.
Also I am only using the |
nice to see i'm not the only one. i was using sveltekit btw :D |
@xxxhussein this is still happening on bun v1.0.11? now running the test code I got this result: import { EncryptJWT, jwtDecrypt } from "jose";
const SECRET = new TextEncoder().encode("12345678912345678912345678912345");
const encrypted = await new EncryptJWT({ hello: "world" })
.setProtectedHeader({
alg: "dir",
enc: "A128CBC-HS256",
})
.setExpirationTime("1h")
.encrypt(SECRET);
const decrypted = await jwtDecrypt(encrypted, SECRET);
console.log(decrypted); {
payload: {
hello: "world",
exp: 1699567220
},
protectedHeader: {
alg: "dir",
enc: "A128CBC-HS256"
}
} |
I have to try it on my own. But since you tried it, I guess it works now. I will try it out as soon as I can. |
yes |
it works now. I was on v1.0.11 and upgraded to v1.0.13 so idk if the fix was in v1.0.12 or v1.0.13 |
There is an implementation here in rust - https://crates.io/crates/x25519-dalek don't know if that could be used. |
Same issue here while running aws cdk with bun. bun: 1.1.20 |
That's unfortunate, considering the 1.1.19 announcement of aws-cdk-lib support |
Just looking at reported cases, this appear to be troubling people using Next, Nuxt, SvelteKit and SolidStart, but it's likely even more are affected. |
yes, what all these have in common is they're vite SSR frameworks |
I've experienced this issue when using AuthJS together with SvelteKit. It only happened when I built and ran the app using bun though, not during development. |
same here. Chenged adapter to @eslym/sveltekit-adapter-bun and PROBLEM SOLVED. |
Me, as same issue happen, was not installing nodejs and results |
What version of Bun is running?
1.0.7
What platform is your computer?
Linux 6.1.0-10-amd64 x86_64 unknown
What steps can reproduce the bug?
use jose in vite as an ssr module
What is the expected behavior?
it works in node
What do you see instead?
SyntaxError: Import named 'diffieHellman' not found in module 'crypto'.
at processTicksAndRejections (:61:39)
Additional information
some code to test
The text was updated successfully, but these errors were encountered: