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

Is there anyway to get Prisma ORM to work with this, Using Native Postgres #71

Closed
gregavola opened this issue Oct 7, 2024 · 7 comments
Labels
wontfix This will not be worked on

Comments

@gregavola
Copy link

It appears there are some missing Node file reads, but I'm wondering if there is anyway to get this working with Prisma. This fails anytime we call the Prisma Client.

"Error: [unenv] fs.readdir is not implemented yet!",

@vicb
Copy link
Contributor

vicb commented Oct 7, 2024

I don't think your issue is related to open next - but to running Prisma on workers.

You can check the docs and ask questions on the cloudflare discord if you need help. It's always better to have a minimal repro when asking for help.

Does it make sense?

@vicb vicb added the wontfix This will not be worked on label Oct 7, 2024
@gregavola
Copy link
Author

Sorry - I should have noted and provided an example repo. The reason why I asked if that this repo intent was allow NextJS apps to run on the node runtime on Workers. I assumed that since Prisma worked on nodejs - that this would do the same.

It appears that Prisma isn't compatible as it's still needs fs - which isn't available in the runtime.

I guess I misunderstood what this package's goals were. Everything else worked perfectly except for a native db connection with Prisma.

I didn't know if there was a workaround for these type of things.

@vicb
Copy link
Contributor

vicb commented Oct 8, 2024

I assumed that since Prisma worked on nodejs - that this would do the same.
It appears that Prisma isn't compatible as it's still needs fs - which isn't available in the runtime.

Prisma works on workers.

You can check the Prisma docs and cloudflare docs.

The thing is that you probably do not have the correct setup for Prisma and that's why I'm directing you the discord to get help with your setup.

@gregavola
Copy link
Author

"When deploying a Cloudflare Worker that uses Prisma ORM, you need to use an edge-compatible driver and its respective driver adapter for Prisma ORM."

Right - it works when you are using a serverless driver. I am looking to connect via standard Postgres native - which is available when using nodejs runtime, which is what I thought this packaged helped you do. I'll connect via discord / thanks!

"You may want to consider using @opennextjs/cloudflare ↗, which allows you to build and deploy Next.js apps to Cloudflare Workers, use Node.js APIs that Cloudflare Workers supports, and supports additional Next.js features."

@vicb
Copy link
Contributor

vicb commented Oct 8, 2024

@gregavola do you think you can close that issue and handle that in the workerd discussion (see #76)?

@gregavola
Copy link
Author

I added it here: cloudflare/workerd#2858 Thanks

@vicb
Copy link
Contributor

vicb commented Oct 9, 2024

I added a ref back to this issue on the discussion. Thanks for moving it there.

@vicb vicb closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants