hello all, I am getting this error when deploying ...
# orm-help
d
hello all, I am getting this error when deploying to AWS Lambda. Locally I can invoke the function deployed in AWS it will fail.
r
Hey David đź‘‹ can you send your Cloudwatch logs so that we can get more insight in this issue?
d
sure thing.. Let me grab them
{
"errorType": "Error",
"errorMessage": "@prisma/client did not initialize yet. Please run \"prisma generate\" and try to import it again.\nIn case this error is unexpected for you, please report it in <https://github.com/prisma/prisma-client-js/issues/390>.",
"stack": [
"Error: @prisma/client did not initialize yet. Please run \"prisma generate\" and try to import it again.",
"In case this error is unexpected for you, please report it in <https://github.com/prisma/prisma-client-js/issues/390>.",
"    at new PrismaClient (/var/task/node_modules/.prisma/client/index.js:3:11)",
"    at Module.call (/var/task/_lumigo/webpack:/src/tasks/shouldOrderProcess.ts:3:16)",
"    at t (/var/task/_lumigo/webpack:/webpack/bootstrap:19:22)",
"    at Object.call (/var/task/_lumigo/webpack:/_lumigo/shouldOrderProcess.js:5:17)",
"    at __webpack_require__ (/var/task/_lumigo/webpack:/webpack/bootstrap:19:22)",
"    at /var/task/_lumigo/webpack:/webpack/bootstrap:83:10",
"    at Object.<anonymous> (/var/task/_lumigo/shouldOrderProcess.js:1:966)",
"    at Module._compile (internal/modules/cjs/loader.js:1158:30)",
"    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)",
"    at Module.load (internal/modules/cjs/loader.js:1002:32)"
]
}
I only see this error
not sure what else you may need
@Ryan Any ideas?
r
Could you check if it's connecting properly to your remote DB locally Also check the following points as well •
prisma generate
is being called before running
serverless deploy
• Your
schema.prisma
has the following for serverless
Copy code
generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
d
Hi Ryan, it looks like the problem is using serverless-webpack
the .prisma folder in node_modules is missing files
r
Could you try this setting in serverless-webpack? Excluding bundling of that should make it work
d
You mean adding “includeModules: true”
r
and configuring the
webpack.config.js
file
d
I actually have that config in the webpack and serverless.yml
I have been trying to hours to figure this out
can we do a quick screen share?
r
sure
d
let me know when you are ready
@Ryan did you mean to meet now?
r
I have joined
d
l
I'm having this same issue deploying to vercel (zeit now). @David Turton did you solve this ?
d
hi @Luke this solved it for me: https://github.com/prisma/prisma/issues/2303 but I decided not to use prisma for now..
basically it needs to have a postinstall script in packages.json to run prisma generate
r
Hey @David Turton đź‘‹ this repo would be helpful for you in the future.