Skip to content

Emit bug: default export is missing when exporting type+named+default #43359

Description

@robpalme

Bug Report

When using a single identifier to export three things (a type, a named export, and a default export) the default export is dropped from the emitted JS.

🔎 Search Terms

"default export" skipped dropped elided omitted forgotten "JS emit" type "named export" "JS+types"

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

💻 Code

type X = number;
export const X = 1;
export default X;

The problem is equally replicable with interface and object types.

🙁 Actual behavior

JS semantics are not preserved in the JS emit:

export const X = 1;

🙂 Expected behavior

export const X = 1;
export default X;

Credit

This bug was discovered by ollupac

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions