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

[bug] React Router v7 completely broke remix-hook-form #12401

Closed
AlemTuzlak opened this issue Nov 26, 2024 · 6 comments
Closed

[bug] React Router v7 completely broke remix-hook-form #12401

AlemTuzlak opened this issue Nov 26, 2024 · 6 comments
Labels

Comments

@AlemTuzlak
Copy link
Contributor

AlemTuzlak commented Nov 26, 2024

I'm using React Router as a...

framework

Reproduction

https://stackblitz.com/edit/github-k5nghg?file=app%2Froutes%2Fhome.tsx

System Info

Doesn't matter, repro above!

Used Package Manager

npm

Expected Behavior

It works

Actual Behavior

it dies.
After my investigation I figured out that it dies in entry.server.ts and if I wrap it into a ClientOnly component then it works. All I did to upgrade remix-hook-form to support react-router v7 is change the peerDependency from @remix-run/react to react-router and this used to work just fine before. I am not sure if something changed internally but I'd expect this to work, the source code that runs is here:
https://github.com/forge42dev/remix-hook-form/blob/main/src/hook/index.tsx
You can see everything I use from react-router there. Thank you for the help!

@brookslybrand
Copy link
Contributor

Looks like the same issue as #12399, we're getting a patch out shortly

Thanks for your patience @AlemTuzlak!

@AlemTuzlak
Copy link
Contributor Author

Thank you Brooks 🫶

@brookslybrand
Copy link
Contributor

Fixed by #12437 and available in v7.0.2

Thanks for your patience Alem! I'm going to go ahead and close this issue

@atarbalouti
Copy link

@brookslybrand @AlemTuzlak I figured out, this is only fixed until node v22, in node v23 it is still causing the same issue :)

@hauptrolle
Copy link

@brookslybrand It is still broken for me even on on node v22.12.0 and react-router v.7.0.2. Using the the same code as @AlemTuzlak in his reproduction.

@brookslybrand
Copy link
Contributor

Re-opened in #12475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants