From ee86cb6c824b4531c403f171cace0778a47fa009 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 6 Mar 2023 16:22:21 +0000 Subject: [PATCH 1/2] clarify build instructions for AWS lambda function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doing a clean checkout then npm run build isn't enough to build the Lambda function - it will result in errors like ``` X [ERROR] Could not resolve "fflate" ../../js/index.ts:1:31: 1 │ import { decompressSync } from "fflate"; ╵ ~~~~~~~~ You can mark the path "fflate" as external to exclude it from the bundle, which will remove this error. ``` --- serverless/aws/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/serverless/aws/README.md b/serverless/aws/README.md index 2372c93..64ffa6a 100644 --- a/serverless/aws/README.md +++ b/serverless/aws/README.md @@ -4,7 +4,9 @@ See installation and configuration instructions at [Protomaps Docs: Deploy on AW ## Development -Building the Lambda ZIP yourself: +The code for the lambda function imports from the top level `js/` directory. You will therfore need to first run `npm install` and `npm run build` in the `js/` directory, and then run `npm run build` in the `serverless/aws` directory. + +You should then be able to build the Lambda ZIP: ```sh npm run build From 75da1623e24e9ff5b4171550d7fb440f29239594 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 6 Mar 2023 16:23:36 +0000 Subject: [PATCH 2/2] correct build-> install in README --- serverless/aws/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/aws/README.md b/serverless/aws/README.md index 64ffa6a..038b498 100644 --- a/serverless/aws/README.md +++ b/serverless/aws/README.md @@ -4,7 +4,7 @@ See installation and configuration instructions at [Protomaps Docs: Deploy on AW ## Development -The code for the lambda function imports from the top level `js/` directory. You will therfore need to first run `npm install` and `npm run build` in the `js/` directory, and then run `npm run build` in the `serverless/aws` directory. +The code for the lambda function imports from the top level `js/` directory. You will therfore need to first run `npm install` and `npm run build` in the `js/` directory, and then run `npm install` in the `serverless/aws` directory. You should then be able to build the Lambda ZIP: