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

TypeScript Error When Transpiling #17

Closed
sebetci opened this issue Sep 22, 2021 · 0 comments
Closed

TypeScript Error When Transpiling #17

sebetci opened this issue Sep 22, 2021 · 0 comments

Comments

@sebetci
Copy link

sebetci commented Sep 22, 2021

Hi @sadikturan,

An error occurs in the TypeScript>Properties section of the tutorial on Udemy; I couldn't reference it because the codes aren't available in this repository. When I enter the tsc properties.ts command on the command line to transpile TypeScript code to JavaScript code, I get the following error:

properties.ts:48:9 - error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

48     get location()

properties.ts:53:9 - error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

53     set location(value: Point)

To solve this problem, it was necassary to explicitly specify he target ECMAScript version in the command line call:

tsc -t es5 properties.ts

Have a nice working day.

Resources

@sebetci sebetci closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant