gpt4 book ai didi

javascript - 捆绑和缩小以及异步/等待

转载 作者:行者123 更新时间:2023-11-30 06:14:56 24 4
gpt4 key购买 nike

我有一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com