Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

V2 config: ignore {file:...} in JSONC comments

Open Beginner friendly
#50,898 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli, tooling

Research direction

The issue is in the V2 config parser's token substitution logic. Look for the code that handles {file:...} tokens, likely in a file like src/config/parser.ts or similar. The fix needs to skip tokens inside JSONC comments (// and /* */), not just lines starting with //. Start by running the provided reproduction steps to see the failure, then examine the linked pull request #50899 for context on the intended fix.

Written by the indexing model from the issue text.

Description

Description

In V2, a {file:...} token inside an inline // or /* ... */ comment in opencode.jsonc is treated as a real file reference. If that file does not exist, an otherwise valid config fails to load. The current substitution code skips only lines that begin with //.

Expected: comments are left alone; only active config values are substituted. Missing files in active values should still be errors.

Related #14478 concerned an active token shadowed by a commented duplicate in the older config path; here V2 dereferences tokens that occur only in comments.

Implementation: #50899 (targets v2).

Plugins

None

OpenCode version

V2 9c8a63e852722a9bced4a0de1179de58a85dfa20

Steps to reproduce
  1. Create opencode.jsonc with:

    {
      "username": "demo" // {file:./not-present.txt}
    }
    
  2. Load the configuration. It fails trying to read not-present.txt even though the token is in a comment. A block comment containing the token has the same problem.

Screenshot and/or share link

Not applicable. A Core config regression test reproduces the failure with NotFound for missing-inline.txt before the fix.

Operating System

Linux x86_64

Terminal

Not applicable (Core test)

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
9h 42m
Merged PRs (30d)
389

Contributor guide

Open the contributing guide

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.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.