unstale

npm / @nestjs/config

@nestjs/config

What changed in @nestjs/config 3 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

22 breaking1 security3 deprecations2 new APIs and options6 behavior and defaults1 tooling4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@nestjs/config 1235 changes

Breaking changes 20

  • Property paths resolve only defined own properties and members of your classes; inherited built-in members return undefined, and paths through __proto__, constructor or prototype are ignored.

    12.1.0release notes

  • set() never writes through inherited built-in members, and paths through __proto__, constructor or prototype are ignored.

    12.1.0release notes

  • get('_PROCESS_ENV_VALIDATED') no longer returns the internal snapshot of validated variables.

    12.1.0release notes

  • A re-expanded value longer than 128 KiB throws.

    12.1.0release notes

  • A value containing a NUL character now fails startup instead of being truncated in process.env.

    12.1.0release notes

  • Expanded values are assigned to process.env after validation; multiple env files are expanded once; and with override: true, self-references expand to the previous value.

    12.1.0release notes

  • __proto__ keys returned by a custom parser are ignored.

    12.1.0release notes

  • Validated values take precedence: undefined or schema-removed variables are not restored from process.env, and skipProcessEnv excludes undeclared variables when a validationSchema is used.

    12.1.0release notes

  • When false, a predefined variable takes precedence over a different env-file value, and get() returns it as-is.

    12.1.0release notes

  • Validation errors no longer include rejected values: Joi pattern() messages omit them, and quoted values are replaced with [redacted].

    12.1.0release notes

  • The explicit type parameter is constrained to the value at the given path, so types inconsistent with the config shape fail to compile.

    12.0.0release notes

  • Existing Joi schemas require Joi v18 or later to implement the Standard Schema specification.

    12.0.0upgrade guide

  • The lodash runtime dependency is removed and replaced by es-toolkit; this matters if you relied on lodash being installed transitively.

    12.0.0release notes

  • The peer dependency range is now ^11.0.0 || ^12.0.0; Nest 10 is no longer supported.

    12.0.0release notes

  • The package is published as pure ESM with an exports map; CommonJS apps can continue using require on Node 20.19+ or 22.12+.

    12.0.0release notes

  • Deep imports into build internals are no longer resolvable; import from the package root instead.

    12.0.0release notes

  • Version 12 requires TypeScript 6 as a peer dependency, so include TypeScript 6 when updating the CLI and schematics.

    12.0.0upgrade guide

  • Validation issues are formatted as path: message, with issues separated by newlines, rather than using the schema library's format.

    12.0.0release notes

  • Library-specific validation settings now belong under libraryOptions in the Standard Schema Options object.

    12.0.0release notes

  • Accepts schemas implementing Standard Schema, including Zod, Valibot, ArkType, and Joi 18+; schemas not implementing the spec are compile-time errors.

    12.0.0release notes

Deprecations 2

  • ConfigService.setEnvFilePaths() is deprecated, and ConfigModule.forRoot() no longer uses it.

    12.1.0release notes

  • ConfigService.setParser() is deprecated, and ConfigModule.forRoot() no longer uses it.

    12.1.0release notes

New APIs and options 2

  • When true, values from .env files take precedence over existing process.env variables; the default remains false.

    12.0.0release notes

  • Accepts a function that parses a Buffer into an object, allowing .env files in formats such as YAML, TOML, or JSON; it is used at bootstrap and during variable re-interpolation.

    12.0.0release notes

Behavior and default changes 6

  • The promise waits until every forRoot() in progress has loaded its environment variables.

    12.1.0release notes

  • A second validated forRoot() no longer replaces the converted values of another one.

    12.1.0release notes

  • ConfigService from a plain imports: [ConfigModule] or ConfigModule.forFeature() is provided after forRoot() has merged its load factories.

    12.1.0release notes

  • Changing a key re-expands dependent variables, including chains, from startup-loaded definitions without rereading env files; earlier set() values and environment-set variables are kept.

    12.1.0release notes

  • validate may be an async function; a rejected promise stops startup.

    12.1.0release notes

  • The option now accepts any Standard Schema-compatible schema, including schemas from Zod, Valibot, and ArkType, rather than being tied to Joi.

    12.0.0upgrade guide

Tooling 1

  • Run this command if a peer dependency conflict is caused by older ts-jest or typescript-eslint releases that do not accept TypeScript 6.

    12.0.0upgrade guide

Fixes and other changes 4

  • ConfigService.set() re-expansion honors the expandVariables.processEnv target.

    12.1.0release notes

  • override: true takes precedence when expanding variables.

    12.1.0release notes

  • Prevents prefix corruption and escapes propertyPath during environment interpolation updates.

    12.0.1release notes

  • Variables omitted by object schemas are merged back into the validated result, keeping unrelated variables reachable through process.env and ConfigService.

    12.0.0release notes

@nestjs/config 43 changes

Breaking changes 1

  • Configuration lookup now checks internal configuration first, then validated environment variables, then process.env; internal configuration takes precedence over environment variables.

    4.0.0release notes

Security 1

  • Prevents ConfigService#get from accessing process.env entirely, allowing applications to restrict direct environment-variable access.

    4.0.0release notes

Deprecations 1

  • The ignoreEnvVars option is deprecated; use validatePredefined set to false to disable validation of predefined environment variables.

    4.0.0release notes

@nestjs/config 31 changes

Breaking changes 1

  • The unused encoding option was removed from the interfaces.

    3.0.0release notes