bundling and minification and async/await

Viewed 500

I have an ASP.NET WebForms Web-Site project and have been using bundling and minification for some time. Now that I am using Async/Await pattern in my javascript the minification part throws an error when it encounters "Async" in the code. Is there a solution for this that I am not aware of?

1 Answers

This still appears to be an open issue: https://github.com/madskristensen/BundlerMinifier/issues/311

Toward the bottom of the thread the user ndenkha offers a work around.

What we ended up doing is removing the await from any HTTP method calls, since the wire trip on the Controller side is async, it seems to work. e.g.

async getUserStuff(userId) {
let userStuff = $.get(/UserConfig/GetUserStuff?userId=${userId});
return userStuff;
}
Related