error with output and accelerate on firebase functions
i update my prisma file adding the output
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}
i'm using using dbClient with
export const dbClient = new PrismaClient().$extends(withAccelerate())
i generated the client with
npx prisma generate --no-engine
deploying my firebase functions i'm receving below error
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
at new PrismaClient (D:\prj\Documentia\documentia\functions\node_modules.prisma\client\edge.js:43:11)
at Object.<anonymous> (D:\prj\Documentia\documentia\functions\lib\utils\utils.js:187:20)
at Module._compile (node:internal/modules/cjs/loader:1562:14)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32)
at Function._load (node:internal/modules/cjs/loader:1123:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1335:12)
at require (node:internal/modules/helpers:136:16)
[2025-04-30T10:16:44.056Z] Got response code 400; body Failed to generate manifest from function source: Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
i'm receiving this error even if i run many times (also without the --no-engine)
npx prisma generate --no-engine
2 Replies
You've gone full bot mode! Let me fetch that AI answer for you ASAP.
Based on the knowledge sources, I can see that you're encountering a common Prisma initialization error when deploying to Firebase Functions. This error occurs because the Prisma client isn't being properly generated or found in the expected location.
The main issue appears to be with your custom
output
path in the schema.prisma file. Several users in similar situations have resolved this by removing the custom output path from their schema.prisma file:
When you specify a custom output path, you need to import the Prisma client from that exact path rather than from @prisma/client
. However, this often causes deployment issues, especially in serverless environments like Firebase Functions.
As mentioned in this discussion, removing the custom output path allowed for successful deployment:
"I also experienced the same error and, on a hunch, decided to remove the custom output. Surprisingly, that allowed for a successful deployment."Another user confirmed this solution in this issue:
"booyah ! just removed the output and worked, thanks"After removing the custom output, make sure to: 1. Run
npx prisma generate
again
2. Import PrismaClient directly from @prisma/client
3. Deploy your Firebase Functions
If you absolutely need a custom output path, you'll need to adjust your import statement to match the exact path where the client is generated, but the simpler solution is to use the default location.
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.as per ai suggestion i should remove output that is a mandatory parameter on coming releases