Skip to content

TypeError: ReactDOMServer.renderToReadableStream is not a function #4608

Closed
@laymonage

Description

@laymonage
  • Check if updating to the latest Preact version resolves the issue

Describe the bug

Hi! I'm trying to update https://github.com/giscus/giscus to the latest Preact version (10.25.2) and I got a TypeError: ReactDOMServer.renderToReadableStream is not a function when I try to load any page. Not sure how helpful it is, but here's the stack trace:

Stack trace
Server Error
TypeError: ReactDOMServer.renderToReadableStream is not a function

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.renderToInitialStream
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/next/dist/server/node-web-streams-helper.js (123:27)
renderShell
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/next/dist/server/render.js (755:57)
Object.renderPage
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/next/dist/server/render.js (671:28)
Object.defaultGetInitialProps
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/next/dist/server/render.js (350:67)
CustomDocument.getInitialProps
node_modules/next/dist/pages/_document.js (19:19)
Object.<anonymous>
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/next/dist/shared/lib/utils.js (75:33)
Generator.next
<anonymous>
asyncGeneratorStep
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/@swc/helpers/lib/_async_to_generator.js (23:28)
_next
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/@swc/helpers/lib/_async_to_generator.js (12:17)
<unknown>
file:///Users/sage/Code/git/github/giscus/giscus/node_modules/@swc/helpers/lib/_async_to_generator.js (17:13)

To Reproduce

Honestly, it's probably my fault for still using Next.js that no longer supports Preact. I'm on Next.js 12.3.4 and next-plugin-preact 3.0.7, as those are the last versions that still work together.

I should probably either move on from Next.js or Preact, but I thought this could possibly a legit bug in Preact, so I'm raising this anyway. Feel free to close this if whatever caused this was intended.

For the record, this still worked fine in 10.23.2. Trying the versions between that and the latest 10.25.2, I found that it started to break in 10.24.0. I couldn't find anything in the release notes that could be related. The closest is probably #4490, but I'm not sure why a warning would cause it to crash.

Expected behavior

I expect it to work just fine, like in 10.23.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions