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

Adding useEffect in HMR causes "Expected static flag was missing" #25719

Open
sebmarkbage opened this issue Nov 21, 2022 · 1 comment
Open

Adding useEffect in HMR causes "Expected static flag was missing" #25719

sebmarkbage opened this issue Nov 21, 2022 · 1 comment
Assignees
Labels
Component: Fast Refresh React Core Team Opened by a member of the React Core Team Type: Bug

Comments

@sebmarkbage
Copy link
Collaborator

Warning: Internal React error: Expected static flag was missing. Please notify the React team.

https://twitter.com/dan_abramov/status/1593609862830759936

This was also repro:ed in Next.js by @sokra:

image

@gaearon
Copy link
Collaborator

gaearon commented Nov 21, 2022

With Fast Refresh the issue is that we shouldn't be counting Hooks after return as part of the signature. I think that's a bug that we should be able to fix.

But I wonder if we should remove this warning altogether. This was attempted in #24525 but never shipped. It always shows up when you have a conditional useEffect, as noted in #24391.

There was also #24535 and then #25216 but they are not shipped either. Maybe worth prioritizing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Fast Refresh React Core Team Opened by a member of the React Core Team Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants