Improvement: Add a log when react-dom is running on RSC instead of SSR #27478
Labels
Resolution: Stale
Automatically closed due to inactivity
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
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
Link to code example: https://github.com/HenriqueLimas/rsc-example/tree/wrong-ssr
The current behavior
By running the code we receive this error
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 errorThe text was updated successfully, but these errors were encountered: