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

Require .prisma/client as dep leeds to unnecessary workarounds #1031

Open
hdngr opened this issue Jan 21, 2021 · 1 comment
Open

Require .prisma/client as dep leeds to unnecessary workarounds #1031

hdngr opened this issue Jan 21, 2021 · 1 comment

Comments

@hdngr
Copy link

hdngr commented Jan 21, 2021

Would be create ensurePeerDep was for .prisma/client | @prisma/client...

In some deployment contexts (e.g. with webpack), I've prebuilt the client with the correct binary, and then am copying it manually as an external into the node_modules that get packaged with my lambda.

Easy enough to switch
import { PrismaClient } from '.prisma/client'

to import { PrismaClient } from '@prisma/client' on my side, but then I end up with the bloat of having the entire @prisma/client package with all of the build scripts, when all I really need is the index file that points to .prisma/client.

Another solution on your side would be if(process.env.NODE_ENV !== 'production') ensureDeps..

Really appreciate the DX around a verbose warning - hey! you can't use this if you don't have the right things... But, I'd like to see this dropped off for instance where the end user is definitely sure they have the right prisma client...

This is an awesome tool, and IMO is one of the most important pieces of the prisma echo system. Thank you!

@hdngr hdngr changed the title Require .prisma/client as dep Require .prisma/client as dep leeds to unnecessary workarounds Jan 21, 2021
@ben-walker
Copy link

Would really appreciate this as well. I'm bundling with @vercel/ncc and have to do some pretty wonky workarounds to get things to load with the current ensureDeps setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants