Skip to content

Compiler gives unhelpful error messages in the presence of multiple default exports  #3886

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
export default class foo {

}

export default function bar() {

}

var x = 10;
export default x;

In the above example, the error messages are:

  1. On foo: "Duplicate identifier 'foo'."
  2. On bar: "Duplicate identifier 'bar'."
  3. On export default x: "Duplicate identifier 'default'."

Then we have...

export default function foo() {

}

export default function bar() {

}
  1. On foo: "Duplicate function implementation."
  2. On bar: "Duplicate function implementation."

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions