Closed jthrilly closed 1 month ago
Hey,
This is handled by Effect which you can see here: https://effect.website/play#3ab9c1685fa3
I brought this up with the Effect team and they're looking at improving this on their end.
Will be fixed in next release https://github.com/Effect-TS/effect/pull/3833
Provide environment information
Describe the bug
In my app, users can optionally provide a
PUBLIC_URL
environment variable when deploying via docker. I used to conditionally add this to the route handler config:The result is that callbackUrl is typed as
string | undefined
which I believe is correct (PUBLIC_URL is defined usingt3-env
asz.string().url().optional()
).This fails in v7 with the following error:
Conditionally adding the property via
...(callbackUrl && { callbackUrl } )
works, so this seems to be an issue caused by the key being defined in the config, even if it is undefined.Link to reproduction
https://github.com/complexdatacollective/Fresco/blob/bccb82009f2eaba4513195d8e45eab832040d841/app/api/uploadthing/route.ts
To reproduce
See description.
Additional information
No response
๐จโ๐งโ๐ฆ Contributing
Code of Conduct