Skip to content

Default export conflicts with star (regression) #37234

Closed
@falsandtru

Description

@falsandtru

TypeScript Version: 3.7.x-dev.201xxxxx

Search Terms:

Code

// src/export.ts
export { GUI as Pjax, GUI as default } from './layer/interface/service/gui';
export { router } from './lib/router';
// index.ts
export * from './src/export';
export { default } from './src/export';
Object.defineProperty(exports, "__esModule", { value: true });
// Define the default export.
__exportStar(_dereq_("./src/export"), exports);
var export_1 = _dereq_("./src/export");
// Redefine the default export and then this operation causes an exception.
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return export_1.default; } });

You can reproduce the error by reverting falsandtru/pjax-api@f814698#diff-ed009b6b86b017532ef0489c77de5100L2-R2
Expected behavior:
pass
Actual behavior:
Uncaught TypeError: Cannot redefine property: default
Playground Link:

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: ES ModulesThe issue relates to import/export style module behaviorFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions