Skip to content

node:console does not support JSON format in console.log #32680

@davidebombelli

Description

@davidebombelli

Version

deno 2.7.5 (stable, release, x86_64-unknown-linux-gnu)

v8 14.6.202.9-rusty

typescript 5.9.2

Steps to reproduce

  1. Create file test.js with the following content:
import console from 'node:console'

const span = {'foo': 'bar'};
const helloworld = 'Hello World!';

console.log('%j %s', span, helloworld);
  1. Run the file like deno test.js.

Expected Behaviour

in Node.js the snippet outputs:

{"foo":"bar"} Hello World!

Actual Behaviour

%j [object Object] Hello World!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions