# TypeScript compilation fails because of not supported feature although JS version is set to ESNEXT

**URL:** <https://community.dynatrace.com/t/typescript-compilation-fails-because-of-not-supported-feature-although-js-version-is-set-to-esnext/38434>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app, coding-assistance\
**Created:** [February 14, 2023, 12:43pm UTC](https://community.dynatrace.com/t/typescript-compilation-fails-because-of-not-supported-feature-although-js-version-is-set-to-esnext/38434 "2023-02-14T12:43:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkusHobisch](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@MarkusHobisch](https://community.dynatrace.com/u/MarkusHobisch)\
**Post date:** [February 14, 2023, 12:43pm UTC](https://community.dynatrace.com/t/typescript-compilation-fails-because-of-not-supported-feature-although-js-version-is-set-to-esnext/38434/1 "2023-02-14T12:43:10Z")

</div>

Hi everyone!

I am trying to use the AWS SDK&nbsp;[@aws](https://community.dynatrace.com/user/23447)-sdk/client-network-firewall&nbsp; to create a new AWS firewall from our custom dynatrace app. When i start the app I get the following error:

_**Transforming async generator functions to the configured target environment (“es2017”) is not supported yet**_

It seems like it thinks that I am using es2017 version of JS but actually I am using the latest one. In tsconfig.json I

have the default value set for target which is ESNEXT.

Do you have any ideas why I am getting this error? I added a picture with the whole error output.

Cheers

Markus

---

<div class="post-metadata">

**Author:** ![stefan\_eggersto](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_eggersto/32/34114_2.png) [@stefan\_eggersto](https://community.dynatrace.com/u/stefan_eggersto)\
**Post date:** [February 14, 2023, 1:25pm UTC](https://community.dynatrace.com/t/typescript-compilation-fails-because-of-not-supported-feature-although-js-version-is-set-to-esnext/38434/2 "2023-02-14T13:25:33Z")

</div>

Hi Markus,

I could reproduce your issue by adding `@aws-sdk/client-network-firewall` as a dependency and add the code

```auto
const client = new NetworkFirewallClient({});

```

to the UI of the app. This leads to an error like

```auto
node_modules/@aws-sdk/client-network-firewall/dist-es/pagination/ListFirewallPoliciesPaginator.js:10: error: Transforming async generator functions to the configured target environment ("es2017") is not supported yet

```

If I write the same code in an app function, the build succeeds.

Based on the error, I assume you are using the SDK in the UI code, but this will not work since requests to external systems are not allowed from the UI code, see [Access external APIs | Dynatrace Developer](https://developer.dynatrace.com/develop/data/access-external-apis/)

Can you try moving your code to an app function and see if it works there?

---

<div class="post-metadata">

**Author:** ![MarkusHobisch](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@MarkusHobisch](https://community.dynatrace.com/u/MarkusHobisch)\
**Post date:** [February 14, 2023, 2:05pm UTC](https://community.dynatrace.com/t/typescript-compilation-fails-because-of-not-supported-feature-although-js-version-is-set-to-esnext/38434/3 "2023-02-14T14:05:08Z")

</div>

Thank you very much! It works perfectly in an&nbsp;app&nbsp;function!
