s3 type error
Not great at typescript so I'm not sure why this is throwing a type error.
3 Replies
apparently type assertions fixes it
I'll just go with that i guess lol
Env variables can be undefined, so Typescript's type for an env var is
string | undefined
, if you have a type string
you cannot assign it string | undefined
because string
is not undefined
, if you want to tell TS that a variable/property is NOT undefined, you can append !
at the end, so in this case you could do this and should be fine:
awesome, makes sense. Thank you