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

File upload is broken with Nextjs #3185

Open
mstfash opened this issue Feb 7, 2024 · 1 comment
Open

File upload is broken with Nextjs #3185

mstfash opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@mstfash
Copy link

mstfash commented Feb 7, 2024

Describe the bug

File upload with yoga and nextjs works fine if its app router, but in pages legacy router it does not work as expected ... while using bodyParser: false it results with 500 error saying

TypeError: RequestInit: duplex option is required when sending a body.
    at new Request (node:internal/deps/undici/undici:7368:19)

and if I remove bodyParser:false I get a file response that is missing most of its built-in functions like stream and arrayBuffer

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

1- Work with yoga (latest version) example and nextjs 14
2- Toggle bodyParser true/false

Expected behavior

for upload to work as expected

Screenshots or Videos

No response

Platform

  • OS: macOS
  • NodeJS: v18.18.0
  • @graphql-yoga/* version(s): 5.1.1
  • Nextjs: 14.1.0

Additional context

No response

@EmrysMyrddin
Copy link
Collaborator

Hi @mstfash and thank you for the report

Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow.

It seems already got into stage 1 thanks to your reproduction! Thank you for that!

Now in order to advance to stage 2 we'll need a failing test, would be great if someone could help progress the issues through the stages.

Thank you and sorry that this comment is not a complete solution (yet).

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