Skip to content

Empty output from tsc and out compiler option acting surprisingly #3950

New issue

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

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

Already on GitHub? # to your account

Closed
NickHeiner opened this issue Jul 21, 2015 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@NickHeiner
Copy link

I would not be at all surprised if I was doing something wrong here or if this problem was due to a lack of my understanding, but I think that tsc should have an error message or something here instead of producing surprising results and exiting with code 0.

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "out": "out.js",
    "noImplicitAny": true,
    "preserveConstEnums": true,
    "noEmitOnError": true
  },
  "files": [
    "index.ts"
  ]
}

index.ts

import log = require('./log');

export = log('hello world');

log.ts

export = function log(message: string): void {
    console.log('[log]', message);
}
λ tsc -v
message TS6029: Version 1.5.3
nick.heiner@nheiner.local:/tmp/ts  λ tsc -p .
nick.heiner@nheiner.local:/tmp/ts  λ echo $?
0

Expected: As noted in the tsconfig.json docs, all my ts files are concatted into a single out.ts file, respecting what I set in tsconfig.json.

Concatenate and emit output to single file. The order of concatenation is determined by the list of files passed to the compiler on the command line along with triple-slash references and imports. See output file order documentation for more details.

Actual: I see index.js and log.js files created, which look correct, but out.js is empty.

@danquirk
Copy link
Member

See #1544

@danquirk danquirk added the Duplicate An existing issue was already created label Jul 21, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants