GithubHelp home page GithubHelp logo

Comments (5)

krutoo avatar krutoo commented on May 1, 2024 2

Is it possible to add renderToReadableStream to Node.js package?

from react.

krutoo avatar krutoo commented on May 1, 2024 1

@MeenuyD I tried your snippet and it doesn't work either

from react.

MeenuyD avatar MeenuyD commented on May 1, 2024

Hello I think this is not the bug in React-dom I have checked both the official documentation repository there are mentions about the reanderToReadableStream there you wrote an incorrect code here is the updated code.

import ReactDOMServer from 'react-dom/server;

const { renderToString, renderToReadableStream } = ReactDOMServer;

console.log({ renderToString, renderToReadableStream });

because the error says that it is the syntax error Named export 'renderToReadableStream' not found. The requested module 'react-dom/server' is a CommonJS module, which may not support all module.exports as named exports.

from react.

thynson avatar thynson commented on May 1, 2024

Node.js exposes WebStream to global since 18.+, but react-dom/server does not export renderToReadableStream without checking if it present.

from react.

marbemac avatar marbemac commented on May 1, 2024

Ditto - often when building and testing things locally the runtime is node, while the final deploy target is edge (cloudflare, etc). Because renderToReadableStream is not exposed on the node build, we have to do a dance to make everything work.

Any particular reason to not include renderToReadableStream on the node build? Made sense when node did not have support for web streams, but it has for a while now, and now that everybody seems to be converging on the web streams standard perhaps it makes more sense to include?

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.