#Ezeikel - Typescript
1 messages ยท Page 1 of 1 (latest)
Hey ๐
Does the Customer object have a value for the email property?
Yeah it all works fine its just that when running tsc i get this error and also VS Code flags it as an issue
I can also see it exists in node_modules
It may be a value that could be null. For the little bit of Typescript I've worked on I've had to add many a .? to indicate that
Okay and the email property is itself nullable
Yeah i can see it is an optional property whereas id is not
What happens if you do put a ? at the end of email?
Hmmm...
Okay, I got an assist from a colleague and based on this Github issue: https://github.com/stripe/stripe-node/issues/1032,
it looks like you need to explicitly cast the value returned as a Customer since you could also get a DeletedCustomer