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

Bun: Weird Plugin behaviour (cached/wrong request yielded) #3131

Closed
klippx opened this issue Dec 6, 2023 · 1 comment
Closed

Bun: Weird Plugin behaviour (cached/wrong request yielded) #3131

klippx opened this issue Dec 6, 2023 · 1 comment

Comments

@klippx
Copy link
Contributor

klippx commented Dec 6, 2023

Describe the bug

When using Bun, the initial request will "prime" the server and it will refuse to yield the correct request on subsequent requests.

This works in Node.

Your Example Website or App

https://codesandbox.io/p/devbox/bun-yoga-yielding-wrong-request-dd3zzk

Steps to Reproduce the Bug or Issue

See README in the codesandbox!

I have also prepared the same repo in node, to verify that this works: https://codesandbox.io/p/devbox/bun-node-yielding-correct-request-67frsn

Expected behavior

It should work the same in Bun as in Node.

I have no clue if this is a Bun issue or Yoga/Envelop issue.

Screenshots or Videos

No response

Platform

  • Bun 1.0.15
  • See package.json for package versions, they are all the latest and greatest at the time of creating this codesandbox

Additional context

No response

@klippx
Copy link
Contributor Author

klippx commented Dec 8, 2023

The fix was

Bun.serve({
  fetch: req => yoga(req)
})

Thanks @EmrysMyrddin !

@klippx klippx closed this as completed Dec 8, 2023
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

No branches or pull requests

1 participant