cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

MarkusHobisch
Dynatrace Participant
Dynatrace Participant

Hi everyone!

I am trying to use the AWS SDK @aws-sdk/client-network-firewall  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                                                            

2 REPLIES 2

stefan_eggersto
Dynatrace Mentor
Dynatrace Mentor

Hi Markus,

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

const client = new NetworkFirewallClient({});

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

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 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?

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

Featured Posts