Typescript: Build target not working from tsconfig.json

Created on 4 Dec 2016  路  3Comments  路  Source: microsoft/TypeScript

TypeScript Version: 2.0.10

{ "compilerOptions": { "module": "commonjs", "target": "es5", "noImplicitAny": true, "sourceMap": true, "noEmitOnError": true, "strictNullChecks": true, "noUnusedParameters": true }, "exclude": [ "node_modules" ] }

Expected behavior:
Should compile into script.js

Actual behavior:

script.ts(51,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
script.ts(55,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

Works when you use the command tsc script.ts --t es5

Most helpful comment

You are getting the error because you are invoking the compiler on a specific file. It is ignoring your tsconfig. If you use tsc -p tsconfig.json or just tsc it will work.

All 3 comments

where is your tsconfig.json relative to script.ts?

both files are in the root directory

You are getting the error because you are invoking the compiler on a specific file. It is ignoring your tsconfig. If you use tsc -p tsconfig.json or just tsc it will work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blendsdk picture blendsdk  路  3Comments

MartynasZilinskas picture MartynasZilinskas  路  3Comments

siddjain picture siddjain  路  3Comments

uber5001 picture uber5001  路  3Comments

manekinekko picture manekinekko  路  3Comments