Select to view content in your preferred language

Typescript setup tutorial not working. URGENT HELP NEEDED - STUDENT EXAMS

1150
3
Jump to solution
11-24-2020 08:55 AM
TommyNygaard
Emerging Contributor

I followed this tutorial: https://developers.arcgis.com/javascript/latest/guide/typescript-setup/

yet when I have done EXACTLY as it is stated in the tutorial now several times today, it returns several errors when writing "tsc main.ts".

It seems to be an error with the package implementation, as typescript is unable to import ESRI from the main.ts file as described in the tutorial. I doubt it is a local issue as my 12 students are all receiving the same error. 

 

I assigned this as an exam last year with no issues, yet now me and all my current students are unable to get this tutorial to work. Urgent help is needed as this is an exam project at the course I am teaching. 

 

Best regards,

 

 

1 Solution

Accepted Solutions
HeatherGonzago
Esri Contributor

`Set` works with ES6 (es2015). You will need to change the `tsconfig.json` file from `es5` to either of these. It should compile without issue. 

 

View solution in original post

3 Replies
HeatherGonzago
Esri Contributor

`Set` works with ES6 (es2015). You will need to change the `tsconfig.json` file from `es5` to either of these. It should compile without issue. 

 

TommyNygaard
Emerging Contributor

Hello, 

 

Thank you very much for the response!

Do you mean changing the "target": to "ES6"? or am I missing something? Could you maybe elaborate. I am mainly a python and R programmer, if this helps. 

 

Best regards, 

TommyNygaard
Emerging Contributor

Alright, I deleted the original folder and redid the tutorial, now changing it to es6. That solved it, thank you very much! The night is saved!

 

Best regards!