I'm working in a project withAngular 5, i was working with this libraries in the versions:
And everything was worked fine until i updated it to versions:
I'm getting this error message with not a clue when deploying with "ng serve":
ERROR in node_modules/@types/arcgis-js-api/index.d.ts(26317,14): error TS2304: Cannot find name 'AbortSignal'.
How can i solve this issue?
Thanks in advance for your help.
I'm not sure what version of TypeScript is being used by that version of angular-cli, but you may need to update it. I'm not sure when the AbortController and AbortSignal types were added to TS, but try to upgrade it and see if that works.
The repo that has the typings lists TS 2.7 as a minimum. jsapi-resources/4.x/typescript at master · Esri/jsapi-resources · GitHub
If you are unfamiliar with AbortSignal, it's a way that you can cancel requests. It's an option to esri/request. I'm not sure how useful it is for users of the API, but we use it internally to do things like abort requests for tiles when you might zoom on before they have been returned. It's fairly low level, but interesting nonetheless.
I checked the page describing AbortSignal, and at the very top of the page is this warning,
Check the Browser compatibility table carefully before using this in production.
I am having a similar issue to the original poster, but not because my Typescript version is out of date (we are using 3.1.3), but I think it is because we are targeting ES5 to try to maintain at least marginal IE11 support.
Are there any known work arounds or shims for AbortSignal so that we can continue targeting ES5?
Sorry for this mixup, we were actually using an older typscript version. Visual Studio Code was using 3.1.3, but our project was referencing version 2.3