DEV Community

Discussion on: Deploy Netlify Functions with TypeScript

Collapse
 
atila profile image
Atila Fassina • Edited

Interesting... it works well for me, code runs as expected and ts-checks return no warnings or errors

❯ tsc --version
Version 4.0.3

❯ yarn ts-check
yarn run v1.22.5
$ tsc --noEmit --lib ES2015 ./src/*.ts
✨  Done in 0.77s.

Plus { msg } definitely exists in type [name: string] : string 😜

Collapse
 
parkan profile image
Arkadiy Kukarkin

ok, I see the issue, the tsconfig I was inheriting from (node12) sets strict: true, which does not pass in this case

specifically, it seems that this fails because strict implies strictNullChecks, and given that this type is nullable it won't pass (if I cast it as { [name: string] : string } it's ok)