我有一个 ASP.NET WebForms 网站项目,一段时间以来一直在使用捆绑和缩小。现在我在我的 javascript 中使用 Async/Await 模式,缩小部分在代码中遇到“Async”时会抛出错误。有没有我不知道的解决方案?
最佳答案
这似乎仍然是一个悬而未决的问题:https://github.com/madskristensen/BundlerMinifier/issues/311
在线程底部,用户 ndenkha 提供了一个解决方法。
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;
}
关于javascript - 捆绑和缩小以及异步/等待,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56718287/