aws-sam-typescript-layers-example icon indicating copy to clipboard operation
aws-sam-typescript-layers-example copied to clipboard

Makefile errors out if types are defined in separate file.

Open schematis opened this issue 3 years ago • 1 comments

I've been following your guide on evilmartians, but the build process errors out at:

echo "{\"extends\": \"./tsconfig.json\", \"include\": [\"${HANDLER}\"] }" > tsconfig-only-handler.json
npm run build -- --build tsconfig-only-handler.json

After looking into it, it appears that the new json file is not created at all and I'm unsure about how to get it to create.

Node: 16.13.1 (Also doesn't work on 14.x) SAM CLI: 1.36.0

schematis avatar Dec 11 '21 04:12 schematis

Ok this is what I believe is the real issue after downloading the template and doing testing to see where it broke.

If I have project specific types defined in a types.d.ts (or similar) file, the makefile will not run the function specific make operations. I moved the types into the relevant file and sam build ran without error.

schematis avatar Dec 12 '21 02:12 schematis