Paul
12/16/2021, 12:17 PMsst deploy
fails with the following error: Error: There was a problem transpiling the Lambda handler.
sst start
is working normally and all lambdas are compiling and running. Deploy also works when I remove my esbuildConfig
. It looks like this: esbuildConfig: { plugins: "config/esbuild.js" }
and contents of esbuild.js:
const { esbuildDecorators } = require("@anatine/esbuild-decorators");
module.exports = [esbuildDecorators()];
Any ideas? I know it would be helpful to get more detailed log output, but the --verbose
flag does not provide more info on the error.thdxr
12/16/2021, 5:19 PMPaul
12/17/2021, 10:01 AM0.54.3
I get more detailed info:
Error: There was a problem transpiling the Lambda handler: > lib/database/entities/PersistedPriceModel.ts:1:18: warning: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
1 │ var __decorate = (this && this.__decorate) || function (decorators, ...
╵ ~~~~
lib/database/entities/PersistedPriceModel.ts:10:0: note: This file is considered an ECMAScript module because of the "import" keyword here
10 │ import { Attribute, Entity, INDEX_TYPE } from "@typedorm/common";
╵ ~~~~~~
Same warning occurs in multiple files that all use decorators. Two options:
1. Seems like sst is interpreting these warnings as errors. So far I found no way to silence the esbuild warnings through sst.
2. Maybe there is an error somewhere but I cannot see it as the log output is truncated after ~100 lines. Would be weird as all functions are building and running with sst start
.thdxr
12/17/2021, 1:01 PMPaul
12/20/2021, 10:47 AMthdxr
12/20/2021, 1:30 PMthdxr
12/20/2021, 2:02 PMPaul
12/20/2021, 3:46 PMPaul
12/20/2021, 4:15 PM