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

Exclude prisma from serverless functions #5160

Open
pi0neerpat opened this issue Apr 13, 2022 · 2 comments
Open

Exclude prisma from serverless functions #5160

pi0neerpat opened this issue Apr 13, 2022 · 2 comments
Assignees
Labels

Comments

@pi0neerpat
Copy link
Contributor

pi0neerpat commented Apr 13, 2022

The Prisma client is incorrectly being added to every function. For example, only 3 of the 7 functions below import the db object. This can be a big problem for hitting the serverless size limit. Its also an inefficient use of resources. Prisma should only be included if needed

image

To reproduce:

yarn rw build api && \
yarn zip-it-and-ship-it api/dist/functions/ zipped

Related to #2250 and #1196

@jtoar
Copy link
Contributor

jtoar commented Apr 16, 2022

Thanks @pi0neerpat. I also see prisma in the node_modules of a zipped function that doesn't use it at all. I'll keep investigating when time permits, but in the meantime, @dac09 @thedavidprice thoughts on this one?

@thedavidprice
Copy link
Contributor

If this is the case, we need to confirm with Netlify team and loop in Prisma team. Netlify owns ZiSi and will need to modify. (Also, not sure if this is a side-effect from them using ESBuild, which has been the cause of previous problems.)

@pi0neerpat We've switched to using Vercel's NodeFileTrace, which you can see in use for our Serverless deploy command here:
https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/deploy/packing/nft.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

4 participants