We had a discussion in here a little while ago abo...
# sst
r
We had a discussion in here a little while ago about using app.setDefaultFunctionProps to set vpc and security group values by passing a callback function. The way we'd been doing it has broken with the most recent release. We used to be able to define our own type to represent the props that were returned. In the new version the TypeScript compiler complains that what we're returning isn't of type FunctionProps. If we change to the latter version in the snippet it now complains that we cannot assign to props.vpc or props.securityGroups because they're read-only
t
This is likely because I narrowed the type of
runtime
to give nice autocomplete of available runtimes
that's probably what is preventing your old way from working
You should be able to fix by defining your DefaultProps like this
Copy code
type DefaultProps = {
  runtime: FunctionProps["runtime"]
}
That said - we should probably not be setting those fields to readonly, don't think that makes sense for a type we expect others to use
Was that why you were specifying your own type? To get around the readonly issue?
r
Yeah, I should have reported it then
t
I made an issue to fix that type. Let me know if updating the typing on
runtime
to
FunctionProps["runtime"]
fixes your issue
r
yeah, that works, thank-you