-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
V2, React: Invalid hook call #1401
Comments
Try adding |
Thank you. you saved the day |
Umm.. It's still not work as expected. It only work if I comment the Here is the repo: https://github.com/xiaoyu-tamu/vite-react-hook-form |
Tested in beta.10 and it works as expected - I think this has to do with the local dependency browser cache - tick disable cache in your devtools and run it again and it should work. |
This does reveal an issue: we currently cache non-optimized dependencies via the version string but they may get rewritten with different imports to optimized deps (with different hashes). So we need to a more precise cache invalidation check here. |
Even disabling the cache and adding (using latest version) |
@thelinuxlich always open new issue with valid repro - commenting on old issues does't get things fixed. |
Describe the bug
add dependencies to optimizeDeps solves the problem, but is it a bug?
Looks like react-hook-form provided esm version, may be that cause the App and the Library refer to different instance of React?
A clear and concise description of what the bug is.
Reproduction
OR
https://github.com/xiaoyu-tamu/vite-react-hook-form
System Info
vite
version:Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: