Skip to content

Missing default when re-exporting with export = #8840

Description

TypeScript Version:

nightly (1.9.0-dev.20160518-1.0)

Code

// export-default.ts
export let foo = "bar";
export default foo;

// re-export.ts
import alias = require("./export-default");
export = alias;

// main.ts
import foo from "./re-export";
console.log(foo);

Expected behavior:
This project should compile and executing main.ts should output "bar".

Actual behavior:
The following compilation error occurs:

main.ts(1,8): error TS1192: Module '"D:/projects/expor-default/re-export"' has no default export.

Comment
This issue prevents typings from exposing default exports ( original typings issue).

The syntax in re-export.ts is used as a workaround for TS preventing the augmentation of module-definitions re-exported with export * from "export-default" (see this issue and this comment).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions