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

ReadableStream has already been used #35

Open
bossmodex opened this issue Dec 27, 2024 · 2 comments
Open

ReadableStream has already been used #35

bossmodex opened this issue Dec 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@bossmodex
Copy link

bossmodex commented Dec 27, 2024

What version of Elysia is running?

1.2.8

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Update elysia from 1.2.6 to 1.2.8

What is the expected behavior?

No response

What do you see instead?

error: ReadableStream has already been used
at mergeResponseWithSetHeaders (\api\node_modules\elysia\src\adapter\web-standard\handler.ts:238:14)
at mapResponse (\api\node_modules\elysia\src\adapter\web-standard\handler.ts:324:16)
at createNativeStaticHandler (\api\node_modules\elysia\src\adapter\bun\handler.ts:18:19)
at add (\api\node_modules\elysia\src\index.ts:733:15)
at get (\api\node_modules\elysia\src\index.ts:3997:8)
at \api\node_modules@elysiajs\apollo\dist\index.mjs:33:11

Additional information

with update elysia 1.2.8 have this error
webstorm64_7gzli6tF08
webstorm64_1QlS5Xit70

when rolling back to 1.2.6 everything works

@bossmodex bossmodex added the bug Something isn't working label Dec 27, 2024
@andresmahor
Copy link

The issue is that app.get expects a handler function, not a Response directly.

if (landingPage)
  app.get(path, () => {
    return new Response(landingPage as string, {
      headers: {
        'Content-Type': 'text/html',
      },
    })
  })

This should fix the issue.
Wait for them to update it.

@Fifixex
Copy link

Fifixex commented Jan 5, 2025

Hello, I have encountered the same issue and wanted to share more details. Here is a screenshot showing the error in my environment:
screenshot

majkio added a commit to majkio/elysia-apollo that referenced this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants