The website uses SignalR. When the user clicks on the browser that comes with the Vivo mobile phone, there is no response. After connecting to the computer with a data cable, I found an error: AbortController is Undefined
after debugging in Chrome. Google looked around and found this article SignalR AbortController is Undefined on Older Browsers , which basically explained the reason and gave a solution.
It is because the old browser supports Fetch, but AbortController does not support it, which leads to this error. Just change the judgment, as long as you don't support one of them, don't use FetchHttpClient.
Put at node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js
if (typeof fetch !== "undefined" || Platform.isNode) {
changed to:
if ((typeof fetch !== "undefined" && typeof AbortController !== "undefined") || Platform.isNode) {
Because it is a direct modification of node_modules, the official library has not been repaired, so you need to patch it yourself.
- Install patch-package:
yarn add patch-package --dev
- Save the module:
npx patch-package @microsoft/signalr
- Add a running command to the scripts of package.json:
"scripts": {
"postinstall": "patch-package",
"patch-package":"patch-package"
},
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。