node-config / node-config/node-config

[BUG] Environment variable substitution fails silently if "__format" parser is not supported

Open Beginner friendly
#753 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking-change bug good-first-issue pr-welcome
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.