Closed chunfenghuayu1 closed 1 year ago
How would you expect this to work? JavaScript cannot read the name of a variable at runtime, so you essentially just passed two unnamed lambdas to the array. The registerAs
function gives the config the key under which to nest the namespaced config. Without it, it has no way of knowing where to put it, so it merges it with the root config object.
Please search through some of our old issues on this (this has been discussed several times in the past).
Is there an existing issue for this?
Current behavior
Minimum reproduction code
https://stackblitz.com/edit/nestjs-typescript-starter-se9i5j?file=src/app.module.ts
Steps to reproduce
No response
Expected behavior
load: [databaseConfig]
Package
Other package
@nestjs/config
NestJS version
9.0.0
Packages versions
Node.js version
18.16.0
In which operating systems have you tested?
Other
No response