Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios版本更新导致larksuite/node-sdk返回数据乱码 #16

Closed
MiDark opened this issue Nov 24, 2022 · 2 comments
Closed

Axios版本更新导致larksuite/node-sdk返回数据乱码 #16

MiDark opened this issue Nov 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@MiDark
Copy link

MiDark commented Nov 24, 2022

axios在最近更新到了1.2.0版本(https://www.npmjs.com/package/axios?activeTab=versions)
在@larksuiteoapi/node-sdk的package.json中配置"axios": ">=0.27.0",
新部署的@larksuiteoapi/node-sdk环境,自动安装1.2.0版本的axios后,调用接口会返回乱码数据,测试代码:

const lark = require("@larksuiteoapi/node-sdk");
const client = new lark.Client({
    appId: "********",
    appSecret: "********",
});
client.im.chat.list({
        params: {
            page_size: 20,
        },
    })
    .then((res) => {
        console.log(res);
    });

手动替换node_modules中的axios版本为1.1.3可恢复正常:
image

@mazhe-nerd
Copy link
Collaborator

axios有相关的issue:axios/axios#5298

@mazhe-nerd
Copy link
Collaborator

axios在最近更新到了1.2.0版本(https://www.npmjs.com/package/axios?activeTab=versions) 在@larksuiteoapi/node-sdk的package.json中配置"axios": ">=0.27.0", 新部署的@larksuiteoapi/node-sdk环境,自动安装1.2.0版本的axios后,调用接口会返回乱码数据,测试代码:

const lark = require("@larksuiteoapi/node-sdk");
const client = new lark.Client({
    appId: "********",
    appSecret: "********",
});
client.im.chat.list({
        params: {
            page_size: 20,
        },
    })
    .then((res) => {
        console.log(res);
    });

手动替换node_modules中的axios版本为1.1.3可恢复正常: image

我把包先锁到>=0.27.0 <1.0.0,等axios官方fix相关issue,sdk升级到1.7.1可用

@mazhe-nerd mazhe-nerd added the bug Something isn't working label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants