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

[Flight] Error if a legacy React Element is attempted to be rendered #29043

Merged
merged 1 commit into from
May 10, 2024

Conversation

sebmarkbage
Copy link
Collaborator

This errors on the client normally but in the case the type is a function - i.e. a Server Component - it wouldn't be transferred to error on the client so you end up with a worse error message. So this just implements the same check as ChildFiber.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 10, 2024
@react-sizebot
Copy link

react-sizebot commented May 10, 2024

Comparing: 6ef0dd4...0d701bb

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.66 kB 6.66 kB +0.05% 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 495.02 kB 495.02 kB = 88.68 kB 88.68 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 499.81 kB 499.81 kB = 89.36 kB 89.36 kB
facebook-www/ReactDOM-prod.classic.js = 592.16 kB 592.16 kB = 104.15 kB 104.15 kB
facebook-www/ReactDOM-prod.modern.js = 568.39 kB 568.39 kB = 100.55 kB 100.55 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-server/cjs/react-server-flight.production.js +0.85% 51.97 kB 52.41 kB +1.52% 10.54 kB 10.70 kB
oss-stable/react-server/cjs/react-server-flight.production.js +0.85% 51.97 kB 52.41 kB +1.52% 10.54 kB 10.70 kB
oss-experimental/react-server/cjs/react-server-flight.production.js +0.78% 56.96 kB 57.40 kB +1.28% 11.30 kB 11.45 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.60% 106.26 kB 106.91 kB +1.07% 23.30 kB 23.55 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.60% 106.26 kB 106.91 kB +1.07% 23.30 kB 23.55 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.54% 118.32 kB 118.96 kB +0.95% 25.91 kB 26.15 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.52% 83.05 kB 83.49 kB +1.01% 17.40 kB 17.57 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.52% 83.05 kB 83.49 kB +1.01% 17.40 kB 17.57 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.51% 85.34 kB 85.77 kB +0.93% 17.60 kB 17.76 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.51% 85.34 kB 85.77 kB +0.93% 17.60 kB 17.76 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.50% 85.66 kB 86.09 kB +0.89% 17.71 kB 17.86 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.50% 85.66 kB 86.09 kB +0.89% 17.71 kB 17.86 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.50% 86.11 kB 86.54 kB +0.89% 17.84 kB 18.00 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.50% 86.11 kB 86.54 kB +0.89% 17.84 kB 18.00 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.50% 86.13 kB 86.57 kB +0.90% 17.84 kB 18.00 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.50% 86.13 kB 86.57 kB +0.90% 17.84 kB 18.00 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.49% 87.72 kB 88.15 kB +0.93% 18.10 kB 18.27 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.49% 88.55 kB 88.98 kB +0.89% 18.28 kB 18.44 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.49% 88.55 kB 88.98 kB +0.89% 18.28 kB 18.44 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.49% 88.57 kB 89.00 kB +0.89% 18.28 kB 18.45 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.49% 88.57 kB 89.00 kB +0.89% 18.28 kB 18.45 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.48% 89.50 kB 89.93 kB +0.83% 18.49 kB 18.65 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.48% 89.50 kB 89.93 kB +0.83% 18.49 kB 18.65 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.48% 89.53 kB 89.96 kB +0.84% 18.48 kB 18.64 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.48% 89.53 kB 89.96 kB +0.84% 18.48 kB 18.64 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.48% 90.05 kB 90.48 kB +1.10% 18.26 kB 18.46 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.48% 90.37 kB 90.80 kB +1.07% 18.36 kB 18.56 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.48% 90.90 kB 91.34 kB +0.86% 18.54 kB 18.70 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.48% 90.93 kB 91.36 kB +0.86% 18.54 kB 18.70 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.46% 93.21 kB 93.65 kB +0.85% 18.96 kB 19.12 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.46% 93.23 kB 93.66 kB +0.84% 18.97 kB 19.13 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.46% 94.16 kB 94.59 kB +0.83% 19.18 kB 19.34 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.46% 94.19 kB 94.62 kB +0.83% 19.18 kB 19.33 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.41% 158.26 kB 158.90 kB +0.70% 34.68 kB 34.93 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.41% 158.26 kB 158.90 kB +0.70% 34.68 kB 34.93 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.39% 163.90 kB 164.54 kB +0.70% 35.86 kB 36.11 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.39% 163.90 kB 164.54 kB +0.70% 35.86 kB 36.11 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.39% 164.60 kB 165.24 kB +0.69% 36.11 kB 36.36 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.39% 164.60 kB 165.24 kB +0.69% 36.11 kB 36.36 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.39% 165.14 kB 165.78 kB +0.66% 36.15 kB 36.39 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.39% 165.14 kB 165.78 kB +0.66% 36.15 kB 36.39 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.39% 165.32 kB 165.97 kB +0.65% 36.23 kB 36.46 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.39% 165.32 kB 165.97 kB +0.65% 36.23 kB 36.46 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.39% 166.13 kB 166.77 kB +0.66% 36.12 kB 36.35 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.39% 166.13 kB 166.77 kB +0.66% 36.12 kB 36.35 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.39% 166.31 kB 166.96 kB +0.66% 36.17 kB 36.41 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.39% 166.31 kB 166.96 kB +0.66% 36.17 kB 36.41 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.38% 168.77 kB 169.41 kB +0.64% 36.91 kB 37.15 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.38% 168.77 kB 169.41 kB +0.64% 36.91 kB 37.15 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.38% 168.95 kB 169.59 kB +0.64% 36.99 kB 37.22 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.38% 168.95 kB 169.59 kB +0.64% 36.99 kB 37.22 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.37% 170.96 kB 171.61 kB +0.70% 37.48 kB 37.74 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.36% 175.96 kB 176.60 kB +0.64% 38.46 kB 38.71 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.36% 176.66 kB 177.30 kB +0.63% 38.71 kB 38.95 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.36% 177.87 kB 178.52 kB +0.61% 38.98 kB 39.22 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.36% 178.06 kB 178.70 kB +0.61% 39.05 kB 39.29 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.36% 178.84 kB 179.48 kB +0.62% 38.93 kB 39.17 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.36% 179.02 kB 179.66 kB +0.64% 38.99 kB 39.24 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.35% 181.48 kB 182.12 kB +0.61% 39.74 kB 39.98 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.35% 181.66 kB 182.30 kB +0.62% 39.81 kB 40.06 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 0d701bb

throw new Error(
'A React Element from an older version of React was rendered. ' +
'This is not supported. It can happen if:\n' +
'- Multiple copies of the "react" package is used.\n' +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'- Multiple copies of the "react" package is used.\n' +
'- Multiple copies of the "react" package are used.\n' +

expectedMessage={
'A React Element from an older version of React was rendered. ' +
'This is not supported. It can happen if:\n' +
'- Multiple copies of the "react" package is used.\n' +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'- Multiple copies of the "react" package is used.\n' +
'- Multiple copies of the "react" package are used.\n' +

@sebmarkbage sebmarkbage merged commit 9d76c95 into facebook:main May 10, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants