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
from parent: Jane Doe
Config {
firstName: 'Jane',
lastName: 'Doe',
fullName: DeferredConfig {
prepare: [Function (anonymous)],
resolve: [Function (anonymous)]
}
}
from sub-module: [object Object]
Which you can see that the config values correctly resolve the values in the parent module. But in the sub-module it does not resolve.
What is the expected behavior?
Based on the wiki, I would expect that config-defer should work with sub modules as well and I should see "Jane Doe" in the sub module index file (I haven't read anything that stated otherwise).
Please tell us about your environment:
node-config version: 3.3.7
node-version: 18.0.0
Other information
The text was updated successfully, but these errors were encountered:
EricLeeSanders
changed the title
Deferred values don't work with sub-modules
Deferred values can't be referenced by sub-modules
Aug 6, 2022
I have not looked closely to see if this possible to implement.
You can submit a PR to find out what's involved and we can discuss any trade-offs from there. I don't think anyone else is going to implement this for you, though.
I'm submitting a ...
What is the current behavior?
Sub-modules that use node-config are not able to reference
deferred
values from the parent module.For example, say you have a
parent
module withnode-config
installed and two config files,default
andproduction
.default.js
production.js
index.js
This correctly prints the full name,
Jane Doe
.However, say I also have a
sub-module
with the following index filechild - index.js
Then I update the
parent module
index file to the following to require the child module.parent - index.js
The output is then:
Which you can see that the config values correctly resolve the values in the
parent
module. But in thesub-module
it does not resolve.What is the expected behavior?
Based on the wiki, I would expect that
config-defer
should work with sub modules as well and I should see "Jane Doe" in the sub module index file (I haven't read anything that stated otherwise).Please tell us about your environment:
Other information
The text was updated successfully, but these errors were encountered: