Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

Fixes #34098.

There's an issue in Chrome where the InvalidStateError always has the same error message. The spec doesn't specify the error message to use but it's more useful to have a specific one for each case like Safari does.

One reason it's better to have a specific error message is because the browser console is not the main surface that people look for errors. Chrome relies on a separate log also in the console. Frameworks has built-in error dialogs that pop up first and that's where you see the error and that dialog can't show something specific. Additionally, these errors can't log something specific to servers in production logging. So this is a bad strategy.

It's not good to have those error dialogs pop up for non-actionable errors like when it doesn't start because the document was hidden. Since we don't have more specific information we have no choice but to hide all of them. This includes actionable things like duplicate names (although we also have a React specific warning for that in the common case).

@meta-cla meta-cla bot added the CLA Signed label Sep 10, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 10, 2025
@react-sizebot
Copy link

Comparing: acada30...7d9cdd2

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.68 kB 6.68 kB +0.11% 1.82 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.65 kB 530.65 kB = 93.49 kB 93.49 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.01% 658.12 kB 658.20 kB +0.02% 115.77 kB 115.79 kB
facebook-www/ReactDOM-prod.classic.js +0.02% 682.25 kB 682.36 kB +0.02% 119.80 kB 119.83 kB
facebook-www/ReactDOM-prod.modern.js +0.02% 672.68 kB 672.79 kB +0.02% 118.11 kB 118.14 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 7d9cdd2

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Wish this wasn't the case but yeah this is annoying.

Easy way to repro this: have a view transition in a sandbox iframe which resizes while the transition is active. I hit that in the View Transition blog post and had to remove the iframe resize logic.

@sebmarkbage sebmarkbage merged commit a34c5df into facebook:main Sep 10, 2025
247 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 10, 2025
Fixes #34098.

There's an issue in Chrome where the `InvalidStateError` always has the
same error message. The spec doesn't specify the error message to use
but it's more useful to have a specific one for each case like Safari
does.

One reason it's better to have a specific error message is because the
browser console is not the main surface that people look for errors.
Chrome relies on a separate log also in the console. Frameworks has
built-in error dialogs that pop up first and that's where you see the
error and that dialog can't show something specific. Additionally, these
errors can't log something specific to servers in production logging. So
this is a bad strategy.

It's not good to have those error dialogs pop up for non-actionable
errors like when it doesn't start because the document was hidden. Since
we don't have more specific information we have no choice but to hide
all of them. This includes actionable things like duplicate names
(although we also have a React specific warning for that in the common
case).

DiffTrain build for [a34c5df](a34c5df)
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.

Bug: Transition was aborted because of invalid state when browser tab not active

3 participants