-
-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
I would expect that when extending a preset it would respect the skipValidation
flag of where it was extended, instead it only follows the preset skipValidation
configuration.
// packages/auth/env.ts
import { createEnv } from "@t3-oss/env-core";
export const env = () => createEnv({
// no skipValidation set
});
// apps/web/env.ts
import { createEnv } from "@t3-oss/env-nextjs";
import { env as authEnv } from "@repo/auth/env";
export const env = createEnv({
// ...
extends: [authEnv()],
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
});
For the code above I would expect that if SKIP_ENV_VALIDATION=true
all validations will be skipped, but thats not the case, the validations for /packages/auth/env.ts
will still run.
To fix it, I need to replicate the skipValidation: !!process.env.SKIP_ENV_VALIDATION,
on each of my presets.
Demo: https://codesandbox.io/p/devbox/7jhxrg
Is this the expected behaviour? It probably should be mentioned at least somewhere in the docs that presets
are fully independent configurations and that they run in a standalone
mode regardless of the options of where they were extended.
OreQr and Abdalrhman-Almarakeby
Metadata
Metadata
Assignees
Labels
No labels