oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.71k stars 2.54k forks source link

Export named 'diffieHellman' not found in module 'crypto' when running in Nuxt server with `bun --bun dev` #9569

Open ZTL-UwU opened 3 months ago

ZTL-UwU commented 3 months ago

What version of Bun is running?

1.0.35

What platform is your computer?

Linux 6.7.6-arch1-2 x86_64 unknown

What steps can reproduce the bug?

Minimal repro: https://github.com/ZTL-UwU/bun-diffieHellman

use jose in a nuxt server

run the app with bun --bun dev

What is the expected behavior?

{
  "payload": {
    "hello": "world",
    "exp": 1711128271
  },
  "protectedHeader": {
    "alg": "dir",
    "enc": "A128CBC-HS256"
  }
}

is shown on the index page.

What do you see instead?

image

Additional information

The same jose script works outside of nuxt even with bun --bun

ssebastianoo commented 2 weeks ago

Same with SvelteKit

image

JosephClay commented 2 weeks ago

Same error encountered with vite macOS arm64 Bun v1.1.12

corbinu commented 2 weeks ago

Still happens with Nuxt in 1.1.13 tested on both macOS amr64 and Ubuntu 24.04 amd64

Screenshot 2024-06-12 at 7 35 15 AM

In my case seems to occur with @nuxtjs/hanko using jose

gemue-parndt commented 1 week ago

I still encounter the error in Bun v1.1.15 when using Auth.JS

birkskyum commented 2 days ago

Similar to: