oven-sh / bun

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

NotImplementedError: worker_threads.Worker option "resourceLimits" ERR_NOT_IMPLEMENTED #10158

Open KostiantynO opened 6 months ago

KostiantynO commented 6 months ago

What version of Bun is running?

1.1.3+2615dc742

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Create next js app with bun

bun create next-app # https://bun.sh/guides/ecosystem/nextjs
bun --bun run dev # http://localhost:3000

Add any jpg image to /public folder and render it in page.tsx

import Image from 'next/image';

export default function Home() {
  return (
    <main className="flex min-h-screen flex-col items-center justify-between p-24">
      <Image
        src="/puppy.jpg"
        alt="puppy"
        width={640}
        height={640}
        priority
      />
    </main>
  );
}

What is the expected behavior?

No errors when using in Next.js v14

What do you see instead?

NotImplementedError: worker_threads.Worker option "resourceLimits" is not yet implemented in Bun. code: "ERR_NOT_IMPLEMENTED"

Additional information

node v20.11.0

bun create next-app # https://bun.sh/guides/ecosystem/nextjs
bun --bun run dev # http://localhost:3000

issue 1:

14 |   warned.add(feature), console.warn(new NotImplementedError(feature, issue));
15 | }, $;
16 |
17 | class NotImplementedError extends Error {
18 |   code;
19 |   constructor(feature, issue) {
                               ^
NotImplementedError: worker_threads.Worker option "resourceLimits" is not yet implemented in Bun.
 code: "ERR_NOT_IMPLEMENTED"

      at new NotImplementedError (internal:shared:19:27)
      at internal:shared:9:73
      at new Worker (node:worker_threads:117:27)

Also, issue 2: cannot start Next.js v14 app with bun, can with node, based on bun docs for nextjs

juniardys commented 5 months ago

is there any updates on this?