Does FDK support Async/Await?

Hi,

I wrote functions in Async/Await manner for ticket sidebar app. When I tried to pack the app it throws me an error saying Parsing error: Unexpected token function. In Freshworks Huddle Q&A I received a response saying Async/Await is supported in FDK. Does FDK support Async/Await?

1 Like

I have used the async await feature in the latest fdk. But it is supported in the server.js file(node) .

fdk uses lint. I believe it might throw an error when using async await in the app.js files.

5 Likes

Hi @arshath.h,
Async/Await functionality is supported only in serverless component of the app. For frontend component, it is not supported

1 Like

Hi @arshath.h,

This has already been given as feedback in this topic.

Keep an eye on this topic and another on our forum announcements for future support on frontend component of the FDK. :smiley:

1 Like

I would also like to join in the request for async/await pattern. I come from a C# background where it is the preferred pattern and working with promises is total garbage especially with the 5 callback limit.

2 Likes

How far in the future?

2 Likes

Thanks all for the awesome responses. Eagerly waiting for Async/Await in frontend. It will definitely change how we develop frontend apps.

3 Likes

I too have run into this. I spent 2 days writing an app and then found when it won’t work when I run fdk pack.

Like Nick above, I really DO NOT want to author in the nested promise callback pattern - its really hard to follow. Async away is far more comprehensible.

Its interesting that it works just fine when authoring locally (with ?dev=true on our freshworks-crm site).

It would be nice to have some ETA on when we can hope to have this supported. I need to decide if I’m going to go thru the headache of rewriting my code - uggh!!

1 Like

Letting y’all know that async/await syntax is now supported using fdk 7. See the migration guide for existing apps for further details. :peace_symbol:

1 Like