node-config / node-config/node-config
[BUG] Environment variable substitution fails silently if "__format" parser is not supported
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.4k
- Forks
- 512
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 1
Description
Describe the bug
Defining a custom-environment-variables.json file with "__format" definitions that do not match a supported parser leads to the configuration being silently ignored.
Example:
{
"hostname": {
"__name": "HOSTNAME",
"__format": "string"
}
}
Expected behavior
An error when attempting to use an unsupported parser.
Screenshots
N/A
Please tell us about your environment:
- node-config version: 3.3.9
- node-version: 20.x
Other information
Related code:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/config.js at the referenced sections around lines 897-902 and 1103-1113, then trace how an unsupported __format parser is handled. Reproduce the custom-environment-variables.json example with __format set to string and make completion mean that unsupported parsers produce an error instead of being silently ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100