defineConfig using --environment type issue with seedFolder
Am I misunderstanding how to use this? I couldn't find docs but saw in recent commit it updated description to point to reference: https://github.com/unjs/c12#environment-specific-configuration
Error: "Type 'string' is not assignable to type 'undefined'.ts(2322)"
10 Replies
Hey 👋
Sorry for the inconvenience. I think you're using it right. Just escape it with
// @ts-ignore
or as any
I'll look into it.Thanks @Igal and no worries at all - let me know if you'd like me to open an issue for tracking purposes
Sure thing
53 in ctl
@Igal sorry one more thing - you think I should add to it that it also only lets you use the environment name strings found in c12's C12InputConfig interface?
Reason I ask is kysely-ctl's src/arguments/environment.mts has valueHint of 'prod | dev | test | ...' but you actually can't use those abbreviations for production and development without other typescript compilation error.
Object literal may only specify known properties, and '$dev' does not exist in type '(C12InputConfig<KyselyCTLConfig<KyselyDialect>, ConfigLayerMeta> & KyselyCTLConfigBase & { ...; } & { ...; } & { ...; }) | ... 7 more ... | (C12InputConfig<...> & ... 3 more ... & { ...; })'.ts(2353)
Good catch!
I will add it to the issue - thanks for taking a look
You actually can.
c12
supports additional environment names.
You use $env
key in your config:
Solution
This should be fine now @ 0.8.9
Thank you!!!