Hi Everyone, I am struggling with my aws lambda d...
# prisma-client
m
Hi Everyone, I am struggling with my aws lambda deployment with Prisma. Currently I am getting following error on lambda execution:
Copy code
{
  "errorType": "TypeError",
  "errorMessage": "collection is not iterable",
  "clientVersion": "3.6.0",
  "stack": [
    "TypeError: collection is not iterable",
    "    at keyBy (/opt/nodejs/node14/node_modules/@prisma/client/runtime/index.js:42314:21)",
    "    at DMMFHelper.getTypeMap (/opt/nodejs/node14/node_modules/@prisma/client/runtime/index.js:42648:17)",
    "    at new DMMFHelper (/opt/nodejs/node14/node_modules/@prisma/client/runtime/index.js:42545:25)",
    "    at new PrismaClient (/opt/nodejs/node14/node_modules/@prisma/client/runtime/index.js:49486:22)",
    "    at Object../apps/tipyourhero-yoga/src/app/context.ts (/var/task/main.js:160:16)",
    "    at __webpack_require__ (/var/task/main.js:880:41)",
    "    at /var/task/main.js:897:19",
    "    at /var/task/main.js:932:3",
    "    at Object.<anonymous> (/var/task/main.js:937:12)",
    "    at Module._compile (internal/modules/cjs/loader.js:1085:14)"
  ]
}
Someone has an idea what the problem is / could be?
Copy code
@prisma and .prisma
are deployed as aws lambda layer
βœ… 1
using @vercel/ncc now and it works easier πŸ˜‰
r
Hi @Mitko Tschimev - I have an example repo that uses Prisma in a lambda layer if you're interested - https://github.com/richardwardza/prisma-lambda-layers It's got a SAM template to assist with deploys ..
It should work except for the one query I think is incorrect but it could be a nice pattern to use
m
Thanks for sharing the repo but it doesn fit exactly to my architecture. I am working inside a mono repo with nx devtools and there I have currently only one package.json There are possibilities to split it up but for the moment the vercel package does it’s job pretty well! Thanks for sharing and I will keep it in my mind if I reach limits with the one from vercel πŸ˜‰
πŸ‘ 1