Open bigwheel opened 2 years ago
@bigwheel Thank you for reporting this issue!
I appreciate your feedback of the library and the clear explanation of the issue :)
I apologize for the inconvenience caused! At this time, my recommendation is to continue using the library with the --no-experimental-fetch
as it is experimental.
In Node.js 18.13.0 they removed the warning message about fetch
being experimental, so I guess it is considered more stable now.
It would be great if it would be officially supported by this package. This package is the only reason we still have node-fetch
in our code now.
This is good feedback. I don't know if this will land in this version (3.x) but I promise we'll be looking into it for our v4.x we are actively working on. I get the struggle and we really want to support native fetch
.
I got the same issue with the Node.js v18.15.0, do you have any plans to have this working?
For me adding the Accept-Language header manually to the request via
.header('Accept-Language', 'en-US')
seems to be a temporary workaround.
The full call for me would be:
const response = await this.client
.api('/applications')
.header('Accept-Language', 'en-US')
.query({
'$filter': 'appId eq \'MY_APP_ID\'',
})
.get();
Any update on this? The fetch
polyfill check is insatiable! Native fetch
has been part of node for a while now, but I can't find a work-around or a way to support current/LTS versions of node :disappointed:
Bug Report
Prerequisites
For more information, see the
CONTRIBUTING
guide.Description
The fetch of node v18 introduces a bug to msgraph-sdk-javascript.
This is simple code.
This works well with node v16. However, in v18 it outputs following error.
Also, it works once more with
--no-experimental-fetch
.Steps to Reproduce
v1.0/applications/deadbeef-xxxx-xxxx-xxxx-xxxxxxxxxxxx
(use existing application id in your tenant)Expected behavior: [What you expected to happen]
Return application property
Actual behavior: [What actually happened]
Additional Context
I was struggling 13 hours because new fetch of v18 works well except
GET v1.0/applications/deadbeef-xxxx-xxxx-xxxx-xxxxxxxxxxxx
endpoint. E.g,GET v1.0/applications
endpoint (list applications) works correctly.Usage Information
Request ID - Value of the
requestId
field if you are receiving a Graph API error response329b85ba-dc7a-4712-b9b7-89e3907972c8
SDK Version - [SDK version you are using]
3.0.2
P.S.
Thank you good library. I'm happy to code with type informations.