Open parasj opened 1 year ago
This issue does not seem to follow the issue template. Make sure you provide all the required information.
@jamesdaniels please are there any updates or work arounds on this? we want to have a step to add prisma generate but currently we're not seeing anyway to do it "gcp-build": "CI=1 && npx prisma generate". works for regular firebase functions but not for the nextjs integrations
@parasj where you able to get this to work correctly?
Up ! I'm seeing this as well. No way to add prisma generate during build.
[REQUIRED] Environment info
Mac OS 13.3.1
firebase --version
: 11.30.0[REQUIRED] Test case
Deploy the sample Next.js Prisma app: https://github.com/prisma/prisma-examples/tree/latest/typescript/rest-nextjs-api-routes
Follow the next.js instructions for Firebase Hosting: https://firebase.google.com/docs/hosting/frameworks/nextjs
[REQUIRED] Steps to reproduce
Upon deploying the function, check Google Cloud Logging where you will see an error:
Proposed fix
After tracing through the documentation, it seems like the issue can be fixed by modifying the Next.js build step: https://github.com/firebase/firebase-tools/blob/ab7af34d8d96ce9f2b84feacc6c52e5bca30f223/src/frameworks/next/index.ts#L417C75-L492 with code to add the following line to the generated package.json file:
As reference, see the added gcp-build step that is added to: https://github.com/prisma/ecosystem-tests/tree/94506e7b2abaf916b2f0413fef858a0ec77dda9b/platforms-serverless/firebase-functions
I also recommend not deleting the "gcp-build" script from package.json here: https://github.com/firebase/firebase-tools/blob/ab7af34d8d96ce9f2b84feacc6c52e5bca30f223/src/frameworks/index.ts#L361