Skip to content

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

Closed
@mattmccutchen

Description

@mattmccutchen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions