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
Perhaps it would help, if the setModuleDefault consistently crashes (with a meaningful error), when it is called on a sealed instance. Or only, but always, when there's already something defined under the specified moduleName.
The change introduced with #507 causes a lot problems in projects, where there are different modules using node-config each calling setModuleDefault. On module loading time, we query the different config params, hence later loaded modules with a node-config produce TypeError crashes or silently swalloed config params.
Perhaps another possibility to avoid these problems would be to seal only the used namespaces of the config object. that way, i can manipulate my moduleFoo namespace as long as it wasn't used.
Please tell us about your environment:
node-config version: 3.0.1
node-version: 10.15.2
The text was updated successfully, but these errors were encountered:
I'm submitting a ...
What is the current behavior?
When the config is sealed, it reacts inconsistently on manipulations with
util.setModuleDefaults
:To reproduce Case 1):
To reproduce Case 2):
What is the expected behavior?
Perhaps it would help, if the setModuleDefault consistently crashes (with a meaningful error), when it is called on a sealed instance. Or only, but always, when there's already something defined under the specified moduleName.
The change introduced with #507 causes a lot problems in projects, where there are different modules using node-config each calling setModuleDefault. On module loading time, we query the different config params, hence later loaded modules with a node-config produce TypeError crashes or silently swalloed config params.
Perhaps another possibility to avoid these problems would be to seal only the used namespaces of the config object. that way, i can manipulate my
moduleFoo
namespace as long as it wasn't used.Please tell us about your environment:
The text was updated successfully, but these errors were encountered: