Skip to content

Babel fails to transform ES module with empty string export name (export { a as "" }) #17283

@magic-akari

Description

@magic-akari

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

const a = "foo";
export { a as "" }

Configuration file name

No response

Configuration

No response

Current and expected behavior

Babel playground

Current behavior

throw error:

@babel/template placeholder "$$BABEL_TPL$1": Expected string substitution

Expected behavior

Correctly handle the empty string export name (e.g., exports[""] = a; for CJS)

Environment

N/A

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions