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

Attempting to use Streaming SSR (Alpha) produces TypeError: readable.getReader is not a function #35050

Closed
1 task done
jstejada opened this issue Mar 4, 2022 · 6 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template.

Comments

@jstejada
Copy link

jstejada commented Mar 4, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64
Binaries:
  Node: 16.8.0
  npm: 7.21.0
  Yarn: 1.22.17
  pnpm: N/A
Relevant packages:
  next: 12.1.0
  react: 18.0.0-rc.1-next-05c283c3c-20220302
  react-dom: 18.0.0-rc.1-next-05c283c3c-20220302

What browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

No response

Describe the Bug

I updated to next@latest and react@next and attempted to enable Streaming SSR as per the instructions here.

I tried using both nodejs and edge for the runtime option in next.config.js, but in both cases when attempting to run the app in development mode and load the page, I get the following error in the console, and the page fails to load:

error - unhandledRejection: TypeError: readable.getReader is not a function

TypeError: readable.getReader is not a function
    at pipeTo (/node_modules/next/dist/server/render.js:1262:29)
    at pipeThrough (/node_modules/next/dist/server/render.js:1283:5)
    at /node_modules/next/dist/server/render.js:1164:69
    at Array.reduce (<anonymous>)
    at /node_modules/next/dist/server/render.js:1164:39
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Looks like the error is happening here: https://github.com/vercel/next.js/blob/canary/packages/next/server/render.tsx#L1899

Additionally, when using nodejs I additionally see this warning: WARNING: Missing strong random number source.

Expected Behavior

Running the app in development mode with Streaming SSR enabled runs without errors and the page is able to load.

To Reproduce

@jstejada jstejada added the bug Issue was opened via the bug report template. label Mar 4, 2022
@jstejada jstejada changed the title Attempting to enable Streaming SSR (Alpha) produces TypeError: readable.getReader is not a function Attempting to use Streaming SSR (Alpha) produces TypeError: readable.getReader is not a function Mar 4, 2022
@huozhi
Copy link
Member

huozhi commented Mar 4, 2022

It's using react rc1 in the codesandbox, you can switch back to rc0 at the moment as workaround to play with streaming features.

react 18 rc1 support is landed in #34972

@huozhi huozhi closed this as completed Mar 4, 2022
@jstejada
Copy link
Author

jstejada commented Mar 4, 2022

@huozhi thanks for the response! I updated the sandbox to use the current rc0 (react@rc) and i'm still seeing the same error:

image

@huozhi
Copy link
Member

huozhi commented Mar 4, 2022

It might be cache on sandbox? it works well on my side can you double check it again?

And make sure it's 18.0.0-rc.0, not 18.0.0-rc.0-next...

image

@Bessonov
Copy link

Bessonov commented Mar 5, 2022

Can confirm that downgrade to:

pnpm add react@18.0.0-rc.0 react-dom@18.0.0-rc.0

works.

@jstejada
Copy link
Author

jstejada commented Mar 7, 2022

ah okay, thank you! the problem was that the rc tag i installed was pointing to rc.1. I can also confirm that rc.0 is working. thanks again!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants