Skip to content

The stack may include duplicate messages #355

@shulaoda

Description

@shulaoda

Reproduction

mini repo:

import consola from "consola";

function trigger() {
    const message = '666'
    throw new Error(message)
}

try {
    trigger()
} catch (e) {
    consola.error(e)

}

output:

PS D:\shulaoda\consola-repo> node .\index.js

 ERROR  666                                                                                            08:46:56  
123

    123
    at trigger (/consola-repo/index.js:5:11)
    at /consola-repo/index.js:9:5
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Describe the bug

Related to rolldown/rolldown#3828

This issue only occurs when the error message contains a newline character (\n).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions