Skip to content

Irrelevant Cannot compile modules using option 'outFile' error when using emitDeclarationOnly #27117

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

Closed
mattmccutchen opened this issue Sep 15, 2018 · 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@mattmccutchen
Copy link
Contributor

Noticed via https://stackoverflow.com/q/52326378 .

TypeScript Version: master (e471856)

Search Terms: cannot compile modules outFile emitDeclarationOnly

Code

// tsconfig.json
{
  "compilerOptions": {
    "declaration": true,
    "emitDeclarationOnly": true,
    "outFile": "out.d.ts"
  }
}
// a.ts
export default 42;

Expected behavior: Successful declaration file generation.

Actual behavior: a.ts:1:1 - error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'.

Playground Link: N/A

Related Issues: None found

@RyanCavanaugh RyanCavanaugh added Working as Intended The behavior described is the intended behavior; this is not a bug Bug A bug in TypeScript Help Wanted You can do this and removed Working as Intended The behavior described is the intended behavior; this is not a bug labels Sep 21, 2018
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Sep 21, 2018
mattmccutchen added a commit to mattmccutchen/TypeScript that referenced this issue Sep 27, 2018
mattmccutchen added a commit to mattmccutchen/TypeScript that referenced this issue Sep 29, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants