Closed kaykhan closed 2 years ago
Hi @kaykhan. if you're using default serverless-esbuild
config, it will bundle everything for you in one file, but to correctly resolve .prisma schema you'll need to let esbuild know hot to treat the schema file, so could you try to define:
esbuild:
loader:
.prisma: text
and let us know if it helps
@floydspace
Not sure what the difference is between what your suggesting and below.
I added the schema.prisma in the following and it works.
package: {
individually: true,
patterns: [
"!node_modules/.prisma/client/libquery_engine-*",
"node_modules/.prisma/client/schema.prisma",
"node_modules/.prisma/client/libquery_engine-debian-*",
"!node_modules/prisma/libquery_engine-*",
"!node_modules/@prisma/engines/**",
],
},
the difference would be that in my example it would put your schema in the bundle during the build step and would not demand the file in runtime.
your solution also works because you copied the schema file in the place where it's expected in runtime and resolves correctly.
I am building a serverless function using the serverless framework. However im having an issue with running it locally
prisma/schema.prisma
serverless.ts
steps:
What am i doing wrong here?
note:
attempting to follow this example: https://github.com/prisma/prisma-examples/tree/latest/deployment-platforms/aws-lambda
i am using the serverless aws-nodejs-typescirpt template which uses serverless-esbuild and not serverless-webpack