14 Feb 2023 12:43 PM - last edited on 20 Apr 2023 08:50 AM by educampver
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
Solved! Go to Solution.
14 Feb 2023 01:25 PM - last edited on 02 May 2023 02:26 PM by educampver
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?
14 Feb 2023 02:05 PM - last edited on 20 Apr 2023 08:31 AM by educampver
Thank you very much! It works perfectly in an app function!