Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emitted declaration file is missing import on enum type #26969

Closed
mattmccutchen opened this issue Sep 7, 2018 · 0 comments
Closed

Emitted declaration file is missing import on enum type #26969

mattmccutchen opened this issue Sep 7, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files

Comments

@mattmccutchen
Copy link
Contributor

From https://stackoverflow.com/q/52216570.

TypeScript Version: master (cbde861)

Search Terms: enum declaration emit missing import

Code

// enum.ts
export enum AnimalEnum { Cat = "Cat" }
export const defaultAnimal = AnimalEnum.Cat;

// main.ts
import { defaultAnimal } from "./enum";
export const myAnimal = defaultAnimal;

Expected behavior: main.d.ts contains:

export declare const myAnimal = import("./enum").AnimalEnum.Cat;

Actual behavior: main.d.ts contains:

export declare const myAnimal = AnimalEnum.Cat;

Playground Link: N/A, multiple files

Related Issues: None found

@weswigham weswigham added Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files labels Sep 17, 2018
@weswigham weswigham self-assigned this Sep 17, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Oct 9, 2018
rix0rrr pushed a commit to aws/aws-cdk that referenced this issue Nov 8, 2018
The package previously published would not work with a TypeScript consumer, because the generated `.d.ts` file was missing an import statement due to a bug in the TypeScript compiler. Add an explicit type declaration to work around this issue until it is fixed and released upstream.

Reference: microsoft/TypeScript#26969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files
Projects
None yet
Development

No branches or pull requests

3 participants