Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SAM CLI instructions recommends invalid BuildProperties #5525

Open
ianwremmel opened this issue Dec 6, 2023 · 3 comments
Open

AWS SAM CLI instructions recommends invalid BuildProperties #5525

ianwremmel opened this issue Dec 6, 2023 · 3 comments
Labels
docs Documentation creation, updates or corrections

Comments

@ianwremmel
Copy link

The instructions at https://www.prisma.io/docs/guides/deployment/serverless/deploy-to-aws-lambda#loading-required-files say to add the following to each function's Metadata.BuildProperties:

Loader:
  - .prisma=file
  - .so.node=file
AssetNames: '[name]'

However, in so doing, sam build fails with

Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: ✘ [ERROR] Invalid option in build() call: "loader:"

and

Error: NodejsNpmEsbuildBuilder:EsbuildBundle - Esbuild Failed: ✘ [ERROR] Invalid option in build() call: "asset-names:"
@ianwremmel ianwremmel added the docs Documentation creation, updates or corrections label Dec 6, 2023
@ianwremmel ianwremmel changed the title AWS SAM CLI instructions reocommends invalid BuildProperties AWS SAM CLI instructions recommends invalid BuildProperties Dec 6, 2023
@nikolasburk
Copy link
Member

Hey @ianwremmel 👋 sorry for the delay on this! Do you recall if you found a solution for this issue by any chance?

@IsaacMM01
Copy link

Hi @nikolasburk I am working on implementing Prisma in a SAM application to enable queries with PostgreSQL. I came across the same documentation mentioned in the post, but as someone with limited experience in CloudFormation or AWS SAM, I find the process of setting it up in a layer a bit challenging. I read this post, Deploying Prisma with AWS Lambda Layers in CDK, as well as this one on deploying Prisma with Serverless, but they don’t fully work for local testing scenarios. Do you have any solutions or documentation that might help with a local setup?

@ianwremmel
Copy link
Author

ianwremmel commented Nov 11, 2024

Mostly, I just chose to ignore those instructions. As far as I can tell, the prisma schema file is not, in fact, necessary at runtime. It's been to long since I did most of this, so I don't remember the details, but this is my prisma config:

generator client {
  provider        = "prisma-client-js"
  binaryTargets   = ["native", "rhel-openssl-1.0.x"]
  previewFeatures = ["driverAdapters", "views"]
}

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
}

My assumption is that, by using prisma-client-js, I don't need to the schema file or the compiled .node.so file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation creation, updates or corrections
Projects
None yet
Development

No branches or pull requests

3 participants