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

fix(api): add duplex configuration to fetch #19

Merged
merged 1 commit into from
May 17, 2023

Conversation

vicrep
Copy link
Contributor

@vicrep vicrep commented Apr 28, 2023

Node sneakily introduced a change to the fetch API that now requires that the duplex option be set on all requests with contain a payload body: nodejs/node#46221 , which means that the CLI now fails on node >18.13, >19.1, 20, with the following exception:

RequestInit: duplex option is required when sending a body.

Exited with code exit status 1

This configures all fetch requests with bodies to set the duplex option to the only value that is allowed by the spec for now, which is "half". This should have no impact on older node versions since it's the only option available, but will allow the CLI to run on those newer versions without throwing an error.

Node sneakily introduced a change to the fetch API that now requires that the `duplex` option be set on all requests with contain a payload body: nodejs/node#46221 , which means that the CLI now fails on node >18.13, >19.1, 20, and running the CLI on those versions will cause the following exception:
```
RequestInit: duplex option is required when sending a body.

Exited with code exit status 1
```

This configures all fetch requests with bodies to set the duplex option to the only value that is allowed by the spec for now, which is `"half"`. This should have no impact on older node versions since it's the only option available, but will allow the CLI to run on those newer versions without throwing an error.
@vicrep
Copy link
Contributor Author

vicrep commented May 4, 2023

@eranimo sorry for the ping, but it's been a week since I proposed this PR, it's a relatively trivial change and will unblock using the CLI on recent minors of node 18/20, so I would appreciate if you could take a quick look at this :)

Thank you in advance!

@eranimo
Copy link
Contributor

eranimo commented May 4, 2023

@eranimo sorry for the ping, but it's been a week since I proposed this PR, it's a relatively trivial change and will unblock using the CLI on recent minors of node 18/20, so I would appreciate if you could take a quick look at this :)

Thank you in advance!

Thank you, we will be reviewing this in our next cycle.

@Yuphonic
Copy link
Contributor

verified this change

@Yuphonic Yuphonic merged commit 88b1877 into LogRocket:master May 17, 2023
@Yuphonic
Copy link
Contributor

This should be bundled into the latest release of the CLI, 0.13.1

@vicrep vicrep deleted the patch-1 branch May 17, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants