Skip to content
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

Add support for Bun #17715

Closed
Sandy-Garrido opened this issue Feb 2, 2023 · 9 comments
Closed

Add support for Bun #17715

Sandy-Garrido opened this issue Feb 2, 2023 · 9 comments
Labels
kind/feature A request for a new feature. team/client Issue for team Client. team/schema Issue for team Schema. topic: bun Bun is a fast all-in-one JavaScript runtime

Comments

@Sandy-Garrido
Copy link

Sandy-Garrido commented Feb 2, 2023

Problem

Bun not yet supported.

Suggested solution

I don't seem to see anything related to bun on search in this repository but it would be good to see Bun supported since it's gaining popularity in its early stages! I'm aware Bun also needs to support Prisma, though I can see it being a huge effort between the 2 development teams.

@toniMR
Copy link

toniMR commented Feb 4, 2023

I suggest you add the kind/features label, to see if it helps a little to make them see it.

Just today I'm trying bun for the first time and I was trying to use prisma.

In my case I get this error:

Cannot find package "async_hooks" from ".../node_modules/@prisma/client/runtime/index.js"

In these bun issues they comment that async_hooks is needed:

@Sandy-Garrido
Copy link
Author

@toniMR unfortunately, the tags are not editable by the public. kind/bug are automatic when you add a bug & the others are added by repo mods/owners

Thanks for adding the additional links from Bun's perspective.

@tomhoule tomhoule added kind/feature A request for a new feature. team/schema Issue for team Schema. team/client Issue for team Client. labels Feb 7, 2023
@Jarred-Sumner
Copy link

It is Bun's responsibility to make Prisma work.

These are bugs in Bun:

Tracking issue in Bun's repository: oven-sh/bun#2083

@Jolg42 Jolg42 added the topic: bun Bun is a fast all-in-one JavaScript runtime label Jun 5, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jun 5, 2023

Thanks to https://github.com/cirospaciari is now closed and Prisma supported on Bun! 🎊

Check out the latest Bun 0.6.7 release:

We're curious to know if it works smoothly for all of you ➡️ let us know here in comments if it worked after you tried it 🙌🏼

@Khamphay
Copy link

Khamphay commented Jun 22, 2023

Hello @Jolg42

I use Bun v0.6.9 and when i use command npx prisma init --datasource-provider mysql have error ReferenceError: Can't find variable: __dirname at line:

43540 : var childPath = path__default["default"].join(eval("__dirname"), "child");

Error detail:

┌──(dev㉿dev)-[~/exp_api]
└─$ bun x prisma init --datasource-provider mysql
[0.02ms] ".env"
1 | __dirname
   ^
ReferenceError: Can't find variable: __dirname
      at ../../node_modules/.pnpm/checkpoint-client@1.1.24/node_modules/checkpoint-client/dist/index.js (/home/dev/exp_api/node_modules/prisma/build/index.js:43540:45)
      at __require (/home/dev/exp_api/node_modules/prisma/build/index.js:14:9)
      at /home/dev/exp_api/node_modules/prisma/build/index.js:99490:25
error: "prisma" exited with code 1 (SIGHUP)

@janpio
Copy link
Member

janpio commented Jun 23, 2023

Can you test if this worked with 0.6.7 @Khamphay? If not, this is probably just something that was overlooked initially (it's not the most common command from Prisma...) and can be reported to bun in their GH repo.

@JonathanWilbur
Copy link

You can see all of the Bun-Node compatibilities here: https://bun.sh/docs/runtime/nodejs-apis

I don't know for sure, but I think a lot of those are going to be complete blockers until they are supported. crypto in particular is missing a lot of parity features.

@janpio
Copy link
Member

janpio commented Sep 16, 2023

Is it officially good enough for us to tick the box, everything works?
I guess we ourselves would need to run our (exteeeeensive) test suite to really confirm that from our side.

@sacummings91
Copy link

sacummings91 commented Sep 26, 2023

PAny chance someone could take a look at this issue in Bun's github and make sure that it's not a Prisma problem? Currently the prisma postinstall hook fails to execute on bun install and bun run prisma generate doesn't work either. oven-sh/bun#5320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. team/client Issue for team Client. team/schema Issue for team Schema. topic: bun Bun is a fast all-in-one JavaScript runtime
Projects
None yet
Development

No branches or pull requests

9 participants