You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
I would expect that when extending a preset it would respect the
skipValidation
flag of where it was extended, instead it only follows the presetskipValidation
configuration.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 astandalone
mode regardless of the options of where they were extended.The text was updated successfully, but these errors were encountered: