简体   繁体   English

Angular 8:条带连接频繁出错

[英]Angular 8: Frequent Stripe Connection Errors

Current stack: Stripe V3 integration + Angular 8 with a nodeJS/AWS lambda backend for my SPA.当前堆栈:Stripe V3 集成 + Angular 8 和我的 SPA 的 nodeJS/AWS lambda 后端。

I've noticed that after upgrading to Angular 8, I frequently lose connection to Stripe which impairs some functionality on various components since I'm making API calls to Stripe to fetch account balance information on component initialization.我注意到在升级到 Angular 8 后,我经常失去与 Stripe 的连接,这会损害各种组件的某些功能,因为我正在对 Stripe 进行 API 调用以获取有关组件初始化的帐户余额信息。 This is what I see frequently in my browser's console:这是我在浏览器控制台中经常看到的内容:

在此处输入图像描述

Refreshing the page fixes the issue but this issue is going to provide a bad user experience.刷新页面可解决问题,但此问题将提供糟糕的用户体验。 I even added the script tag at the bottom of each component file's HTML file to reload Stripe when rendering new components but no luck there.我什至在每个组件文件的 HTML 文件的底部添加了脚本标签,以便在渲染新组件时重新加载 Stripe,但那里没有运气。 I'm curious to know if anyone else is experiencing the same issue or has ran into this issue and managed to solve it.我很想知道是否有其他人遇到同样的问题或遇到了这个问题并设法解决了它。

Thanks in advance!提前致谢!

I'm not sure how this could be related to Angular versions.我不确定这与 Angular 版本有何关系。 Calling to retrieve this balance is happening in the backend, presumably on one of your lambdas using stripe-node .调用以检索此余额发生在后端,大概是在您的一个使用stripe-node的 lambdas 上。

If you can update your question to provide more details about the request you're making, maybe there will be suggestions to help.如果您可以更新您的问题以提供有关您提出的请求的更多详细信息,也许会有一些建议可以提供帮助。 But failing that your app should handle these failures and not try to access data on a null response.但是,如果您的应用程序无法处理这些故障,而不是尝试访问 null 响应中的数据,则失败了。 Instead, maybe should a "retry" UI while you work on the issue with the requests.相反,当您处理请求问题时,也许应该“重试” UI。

One additional thing to try is to verify reachability from anywhere you make calls to Stripe's API.要尝试的另一件事是验证从任何地方调用 Stripe 的 API 的可达性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM