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

Improvement: Add a log when react-dom is running on RSC instead of SSR #27478

Closed
HenriqueLimas opened this issue Oct 7, 2023 · 3 comments
Closed
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@HenriqueLimas
Copy link
Contributor

HenriqueLimas commented Oct 7, 2023

When a SSR file is being wrongly considered as an RSC, the error log is not easy to understand. After #27436 react-dom started importing only the react.shared-subset file and not the react.production. This causes the error here where ReactCurrentCache is undefined. Although this is the correct behavior, a better error message would help to understand the issue.

React version: canary, >= 18.3.0-canary-a6ed60a8e-20230929

Steps To Reproduce

  1. Wrongly consider an SSR file as part of RSC (react-server condition)

Link to code example: https://github.com/HenriqueLimas/rsc-example/tree/wrong-ssr

The current behavior

By running the code we receive this error

TypeError: Cannot read properties of undefined (reading 'current')

The expected behavior

A better error message similar to the one used on react-server (The "react" package in this environment is not configured correctly. `) would be better to understand the error

@HenriqueLimas HenriqueLimas added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Oct 7, 2023
@arjunsohal12
Copy link

Hi, I'd like to work on adding the error log for this!

Copy link

github-actions bot commented Apr 6, 2024

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 6, 2024
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants