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

Verify compatibility with Node 18 #980

Open
nikithauc opened this issue Sep 28, 2022 · 1 comment
Open

Verify compatibility with Node 18 #980

nikithauc opened this issue Sep 28, 2022 · 1 comment
Labels

Comments

@nikithauc
Copy link
Contributor

nikithauc commented Sep 28, 2022

-[] fetch is introduced globally in Node 18. Verify the compatibility in 3.0.0 and 4.x-previews
-[] Verify stream upload using LargeFileUploadTask

@nikithauc nikithauc self-assigned this Sep 28, 2022
@nikithauc nikithauc added enhancement P1 Priority P0 Priority and removed P1 Priority labels Sep 28, 2022
@ntsim
Copy link

ntsim commented Nov 18, 2023

Ran into a bit of an issue with the putStream method, which I think is related to Node 18. With the following code:

const stream = fs.createReadStream('the path');
await client.api(...).putStream(stream);

Get the following error: Could not upload file to Sharepoint RequestInit: duplex option is required when sending a body.

Seems like this is related to changes in the Fetch spec: nodejs/node#46221

Thankfully, we can pass in the duplex: "half" Fetch option i.e.

await client.api(...)
  .options({ duplex: 'half' })
  .putStream(stream);

However, this seems a little clunky and is not very obvious or ergonomic. Would suggest automatically applying this option internally (if it's not been set).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants