getStream doesn't work on node 18
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Start by reproducing the failure with Node 18.8.0 using client.api(imageUrl).getStream() from the report, then trace the SDK entry point for .getStream() and how its response is handled. Done means the call returns a stream that supports stream.on('data', ...) for the reported photo request.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
Prerequisites
- Can you reproduce the problem?
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
For more information, see the CONTRIBUTING guide.
Description
The .getStream() method doesn't work when running on node 18.
Console Errors: [Is there any console error]
TypeError: stream.on is not a function
Screenshots: [If applicable, add screenshots to help explain your problem]

Steps to Reproduce
Here is a small application to reproduce the issue(just include the IDs):
import 'isomorphic-fetch'; // unnecessary and can be removed
import { Client } from '@microsoft/microsoft-graph-client';
const tenantId = '';
const clientId = '';
const clientSecret = '';
const userID = '';
const createAccessToken = async ({ tenantId, clientId, clientSecret }) => {
const params = new URLSearchParams();
params.append('grant_type', 'client_credentials');
params.append('client_id', clientId);
params.append('client_secret', clientSecret);
params.append('scope', 'https://graph.microsoft.com/.default');
const response = await fetch(
`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`,
{
method: 'POST',
body: params,
}
);
const { access_token } = await response.json();
return access_token;
};
const createClient = async connectionConfig => {
const accessToken = await createAccessToken(connectionConfig);
return Client.init({
authProvider: done => {
done(null, accessToken);
},
});
};
const run = async () => {
const imageUrl = `/users/${userID}/photo/$value`;
const client = await createClient({ tenantId, clientId, clientSecret });
const photo = await client.api(imageUrl).get();
console.log({ photo }); // <-- photo is loaded
const stream = await client.api(imageUrl).getStream();
// fails with: stream.on is not a function
stream.on('data', data => {
console.log(data);
});
};
run();
Expected behavior: [What you expected to happen]
a stream to be returned by .getStream() function
Actual behavior: [What actually happened]
.getStream() function is not returning a stream
Additional Context
Node 18 is used
Usage Information
Request ID - Value of the requestId field if you are receiving a Graph API error response
SDK Version - [SDK version you are using]
3.0.2
- Node (Check, if using Node version of SDK)
Node Version - [The version of Node you are using]
18.8.0
- Ngôn ngữ chính
- TypeScript
- Star
- 833
- Fork
- 240
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
Is anyone here? Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reaction ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Đang mởstatus:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
-
status:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 bình luận · 1 reaction ·
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của microsoftgraph/msgraph-sdk-javascript
Issue tương tự
-
Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenNSW/nsw-srilanka#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
digidem/comapeo-cloud-app#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100