我正在尝试将我的 firebase 用户动态连接到我的 chatengineio 项目,但我不断收到 502 错误,提示“未处理的拒绝:TypeError:helper.createServerWithHelpers 不是函数”。我不确定这是我的代码还是我正在使用的 vercel 版本(23.1.2)的问题,但我在网上找不到任何有用的东西?
我正在使用vercel运行。这是我用来向 ChatEngineIo 发送帖子的方法:
const createUser = async (req, res) => {
const { userId, userName } = req.body;
axios
.post(
"https://api.chatengine.io/projects/people/",
{ username: userName, secret: userId },
{
headers: {
"Private-Key": process.env.chat_engine_private_key,
// "key": "access-control-allow-origin",
// "value": "*"
}
}
)
.then(apiRes => {
res.json({
body: apiRes.data,
error: null,
});
})
.catch(() => {
res.json({
body: null,
error: "There was an error creating the user!",
});
});
};
export default createUser;
and I keep getting a 502 error saying "Unhandled rejection: TypeError: helper.createServerWithHelpers is not a function". I am not sure if this is an issue with my code or with the vercel version I am using (23.1.2) but I can't find anything helpful online?