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

TypeError: source.on is not a function #102

Closed
ducnm98 opened this issue Aug 27, 2024 · 1 comment
Closed

TypeError: source.on is not a function #102

ducnm98 opened this issue Aug 27, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ducnm98
Copy link

ducnm98 commented Aug 27, 2024

image

TypeError: source.on is not a function at DelayedStream.create (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/delayed-stream/lib/delayed_stream.js:33:10) at CombinedStream.append (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/combined-stream/lib/combined_stream.js:45:37) at FormData.append (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/form-data/lib/form_data.js:75:3) at build (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/toFormData.js:63:16) at each (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/toFormData.js:58:9) at Object.forEach (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/utils.js:276:12) at build (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/toFormData.js:40:13) at toFormData (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/toFormData.js:67:3) at Object.transformRequest (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/defaults/index.js:80:14) at transform (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/transformData.js:18:15) at Object.forEach (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/utils.js:270:10) at Object.transformData (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/transformData.js:17:9) at dispatchRequest (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/dispatchRequest.js:35:31) at Axios.request (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/core/Axios.js:109:15) at Function.wrap [as request] (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/node_modules/axios/lib/helpers/bind.js:9:15) at Client.<anonymous> (/Users/michael/Projects/funitech/chatbot-ai-be/node_modules/@larksuiteoapi/node-sdk/lib/index.js:48123:26)

When running this functions

const client = new lark.Client({ appId: token.thirdPartyId, appSecret: token.accessToken, appType: lark.AppType.SelfBuild, domain: lark.Domain.Lark, }); try { request(link) .pipe(fs.createWriteStream(./temp/${key}.png)) .on("close", async () => { let res = await client.im.image.create({ data: { image_type, image: await fs.readFileSync(./temp/${key}.png), }, }); fs.unlinkSync(./temp/${key}.png`);

      return resolve(res);
    });`
@mazhe-nerd
Copy link
Collaborator

Duplicate of #39

@mazhe-nerd mazhe-nerd marked this as a duplicate of #39 Aug 28, 2024
@mazhe-nerd mazhe-nerd added the duplicate This issue or pull request already exists label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants