billions-greece-72352
09/07/2021, 7:10 AMconst { isLeft } = await import("fp-ts/lib/Either");
Which is `tsc`'d into:
const { isLeft } = await Promise.resolve().then(() => __importStar(require("fp-ts/lib/Either")));
Where __importStar
is defined at the top most level of the file.
After function serialisation, it appears that the __importStar
definition is not retained (i.e. it hasn't been captured?) so the lambda fails during invocation.
When I switch importHelpers
on in tsconfig.json
, it does work. The tsconfig.json from the aws-typescript template doesn't have this set.
So... can anyone shed light on the expected way to import those runtime dependencies?dry-florist-5950
09/07/2021, 11:59 AMconst { isLeft } = await import("fp-ts/lib/Either");
in ts would be
import { isLeft } from 'fp-ts/lib/Either'
assuming the library supports ts