gpt4 book ai didi

javascript - 检索事件从 getstream.io API 返回未定义的错误

转载 作者:行者123 更新时间:2023-11-28 05:12:07 25 4
gpt4 key购买 nike

我正在遵循 getstream 的文档步骤一切都很顺利,直到“Retrieving Activities ”步骤。

<小时/>

正在运行

import stream from 'getstream' // stream-js v3.5.0
const client = stream.connect(APP_KEY, null, APP_ID, { location: 'eu-west' });
const user1 = client.feed('user', '1', READ_ONLY_TOKEN);

user1.get({ limit:5, offset:5 })
.catch((errorData) => {
console.log(errorData);
});

给我

{
error: undefined,
response: {
statusCode: 0,
request: {
uri: {
protocol: "https:",
slashes: true,
auth: null,
host: "api.getstream.io",
port: null,
hostname: "api.getstream.io",
hash: null,
search: "?limit=5&offset=5&api_key=...secret...&location=unspecified",
query: "limit=5&offset=5&api_key=...secret...&location=unspecified",
pathname: "/api/v1.0/feed/global/global/",
path: "/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified",
href: "https://api.getstream.io/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified"
},
method: "GET",
headers: {
stream - auth - type: "jwt",
Authorization: "...secret...",
["X-Stream-Client"]: "stream-javascript-client-browser-unknown",
accept: "application/json"
}
}
}
}
<小时/>

我可以在这里尝试什么建议吗?

最佳答案

这是一个错误,描述于 GetStream/stream-js#99 ,getstream.io 团队刚刚修复了这个问题。

@JelteF:

I found out the problem. Meteor has its own browser fallback for the request lib that has a different default for withCredentials. This overrides the request browser library that I mentioned before. PR #100 should fix this by setting withCredentials explicitly.

...

I merged it into master, you can use install from there for now until it is released.

感谢大家的辛勤付出!

关于javascript - 检索事件从 getstream.io API 返回未定义的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41285421/

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