Skip to content

export { default } from broken in 2.9 #24528

@milesj

Description

@milesj

TypeScript Version: 2.9.1 (also tried 3.0.0-dev.20180531)

Search Terms: export default, export default from

Code

A project that was working on 2.8 started failing on 2.9 with this error:

.../dts/Schema.d.ts:6:46 - error TS2507: Type 'typeof import(".../node_modules/shapeshifter/...' is not a constructor function type.

export default class Schema<T = any> extends BaseSchema {

The shapeshifter declaration looks like the following.

export { default } from './Schema';
export { MetadataField, PrimaryKey, Relation } from './types';

The above causes the error, while the following does not cause the error.

import Schema from './Schema';
export { MetadataField, PrimaryKey, Relation } from './types';
export default Schema;

Expected behavior:

It doesn't error and supports export { default } from.

Actual behavior:

It errors.

Related Issues: N/A

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions