Skip to content

Regression v4, definition files import typescript files #40852

Closed
@VincentBailly

Description

@VincentBailly

In some situation TS v4 would create a declaration file which imports a TypeScript source file. This is an issue because we don't ship our TypeScript files to npm but only our .js and .d.ts file. So this makes our consumers fail to build.

TypeScript Version: 4.1.0-dev.20200930

Search Terms:
.d.ts
import

Code

See repo here: https://github.com/VincentBailly/TS-bug-repro

Expected behavior:

This is the behavior with latest TypeScript version ^3.0.0

$ cat packages/search-core-notification/lib/Store/NotificationStore.d.ts 
export declare const NotificationScenario: () => import("../API/NotificationAPIUtils").NotificationResponse;

Actual behavior:

Note that the file imported is a TS file and NOT a definition file.

 $ cat packages/search-core-notification/lib/Store/NotificationStore.d.ts 
export declare const NotificationScenario: () => import("search-core-notification/src/API/NotificationAPIUtils").NotificationResponse;

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesFix 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