apollo-client|apollo-client 报错 DOMException: The user aborted a request.
最近用umijs,react开发项目,后端使用GraphQL技术数据映射,前端使用Apollo Client
问题
【apollo-client|apollo-client 报错 DOMException: The user aborted a request.】1.请求时候总是报错
devScripts.js:6791 Uncaught Error: The error you provided does not contain a stack trace.Uncaught (in promise) DOMException: The user aborted a request.
文章图片
- 看到这报错一脸懵逼,百度也没有对应的,还是在GitHub @apollo/client官网下issues
const abortController = new AbortController();
const httpLink = createHttpLink({
uri: `${LOTTERY_API_URL}/graphql`,
fetchOptions: {
mode: 'cors',
signal: abortController.signal,
},
});
const client = new ApolloClient({
cache: new InMemoryCache(),
link:httpLink,
});
apollo-client文档: https://www.apollographql.com...
参考:https://github.com/apollograp...
推荐阅读
- idea 使用 mvn clean package 报错 Could not create local repository
- python|python常见报错合集
- unity|微信SDK 接入xcode构建时,libiPhone-lib.a报错的问题
- IT|iOS - 将Unity导出的Xcode工程导入到另一个Xcode项目, 及常见报错的解决方法
- #|Oracle报错(ORA-01034 或者 ORA-27101 终极解决办法(图文))
- java|spring boot报错org.springframework.context.ApplicationContextException:Unable to start Embedded
- Python|Python pip 安装第三方库报错
- python爬虫常见报错_Python爬虫系列之什么是爬虫
- 微信小程序|微信小程序报错(“errMsg“:“request:fail url not in domain list“} Object)
- 测试|Selenium报错: Message: stale element reference: element