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

Using debug with `esm` renders wrong formatted output for %o / %O

Open
#744 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
devtools

Research direction

Start by reproducing the two node commands shown in the issue, comparing require("debug") with and without -r esm and the %o/%O formatting paths. Trace the formatting entry point used by debug for these placeholders; done means the encoded colons render identically in both commands.

Written by the indexing model from the issue text.

Description

bug

Using debug with or without esm produces different formatted output using %o or %O:

$ DEBUG=topic node -r esm -p 'require("debug")("topic")("out: %o", { foo: "?date=2020-01-29T14%3A24%3A44.806Z" })'
  topic out: { foo: '?date=2020-01-29T14undefinedA24undefinedA44.806Z' } +0ms
undefined

whereas the following correctly renders

$ DEBUG=topic node -p 'require("debug")("topic")("out: %o", { foo: "?date=2020-01-29T14%3A24%3A44.806Z" })'
  topic out: { foo: '?date=2020-01-29T14%3A24%3A44.806Z' } +0ms
undefined
Dominant language
JavaScript
Stars
11.5k
Forks
992
PR merge metrics
No merged PRs in 30d

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.

More from debug-js/debug

All issues in debug-js/debug

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.