Skip to content

Error in renderToPipeableStream: ReferenceError: React is not defined #3159

Open
@austinm911

Description

Which project does this relate to?

Start

Describe the bug

I have a turborepo monorepo "playground" that contains another existing NextJS app (from the template). Went ahead to add TSS and noticed these errors. Seems related to #2793

Error in renderToPipeableStream: ReferenceError: React is not defined
    at RootComponent (/Users/am/Coding/git/router/apps/playground/src/routes/__root.tsx:38:3)
    at react-stack-bottom-frame (/Users/am/Coding/git/router/node_modules/react-dom/cjs/react-dom-server.node.development.js:8723:18)
...

When importing React and console logging it in _root.tsx and uncommenting out the NotFound component in router.tsx

Error in renderToPipeableStream: ReferenceError: React is not defined
    at defaultNotFoundComponent (/Users/am/Coding/git/router/apps/playground/src/router.tsx:21:61)
    at react-stack-bottom-frame (/Users/am/Coding/git/router/node_modules/react-dom/cjs/react-dom-server.node.development.js:8723:18)
...

Your Example Website or App

https://github.com/austinm911/router/tree/renderToPipeableStream-bug

Steps to Reproduce the Bug or Issue

  1. Go to apps/playground and run dev server
  2. You see see the error
  3. Import React and uncomment NotFound as described above

Expected behavior

No error

Screenshots or Videos

No response

Platform

Mac

Additional context

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions