-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
useSubmit must be used within a data router. (React Router 7) #127
Comments
This usually happens when you have multiple react router versions in your project, check if you have any remix dependencies alongside your react-router |
I have checked there is no remix dependencies. Screen.Recording.2024-11-24.154907.mp4 |
Could you create a minimum repro? I'm not sure why this would happen |
const form = useRemixForm({ when i comment this code and reload the page is working good. there is no error. |
I'll try it out |
@mjjabarullah have you found any solution? |
@stilyng94 Not yet |
I'm looking into this tomorrow! |
I've pinpointed the issue to the A workaround for now is to wrap forms with but you probably don't want to do that as it skips server side rendering |
remix-run/react-router#12401 |
i got same issue in here |
It's an issue on react-router side, they released v7.0.2 that should fix it! |
It is still broken for me even in |
did you upgrade ALL the react-router packages @hauptrolle ? I tried it out myself and it works now |
I can also confirm that it works with |
Are u guys on |
Vite 5, vite 6 doesn't work yet with react-router from what I've heard and seen on their discord |
@hauptrolle might be your node version. The fix wasn't working for me on node |
@corygibbons Hmm I am on node |
@hauptrolle can you post your package json |
|
Hot-reloading removes the error. But after a hard page reload is appears again. |
Can you maybe try clearing out node modules and removing the lock and installing again, maybe there's an issue there |
Did it already multiple times. Still same error. |
After upgrading react-router package to 7.0.2. It is working for me. Thanks for your support @AlemTuzlak |
Maybe try to use node v22 or lower, for me this was also the issue that I used node v23. |
still got the error, i following your guide |
Good to know that I am not the only one :) |
Even after an clean install like in your reproduction @AlemTuzlak I still get this error. On |
This is something that needs to be fixed on react-router side, I have nothing to do with the cause of it. Our best bet to get this working for everyone is to write on the linked issue on their side to get visibility on it. |
@hauptrolle I didn't manage to fix the problem |
remix-run/react-router#12475 |
I was having the same issue, but realised that the node version was only being set in the terminal window where I was running n.b Only |
When reloading the page in browser. Application error occur
The text was updated successfully, but these errors were encountered: