-
-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Description
When a non optional property has been defined on ProcessEnv by interface merging, it is not possible to use execa's env & extendEnv options to add additional environment variables to execa process.
Example
import { config } from "~/config.server";
import { execa } from "execa";
// from @remix-run/node
interface ProcessEnv {
NODE_ENV: "development" | "production" | "test";
}
// attempting to extend process env results in TS error "No overload matches this call."
const $ = execa({
stdio: "inherit",
extendEnv: true,
env: {
DATABASE_URL: config.DATABASE_URL,
},
});
await $`prisma db push --accept-data-loss`;Suggestion
Instead of env option being typed as typeof import('node:process').env. Maybe it should be typed as Record<string, string | undefined>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels