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
Hi Markus,
I could reproduce your issue by adding @aws-sdk/client-network-firewall as a dependency and add the code
<span>const</span> <span>client</span><span> = </span><span>new</span> <span>NetworkFirewallClient</span><span>({});</span>
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 Access external APIs | Dynatrace Developer
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!