-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fetcher.load is causing the whole page to reload #1220
Comments
Oh yep, I'm getting into this code: remix/packages/remix-react/routeModules.ts Lines 109 to 117 in 1fd7096
Not sure why yet. |
Would this cause useFetcher to follow redirects? (Which I didn't think they were supposed to do): #1204 |
Found it. It's because I had server code in my movies route so the try/catch around loading the module reloaded the page. Once I got that out it worked fine. Our work to automatically mark our route entries as side-effect free (or the better error message) that we're already working on will make this a non-issue. Anyway, solution is like any other time you get server code in browser bundles, move the imports into a separate file (and if you feel like, it, tack on @kentcdodds |
@ryanflorence Thanks for the follow up and clarification, glad you found your issue 😄. Just to make sure I'm understanding correctly, If that's correct, then I believe #1204 is still a valid RFC to improve UX for users without javascript and DX for developers who want to use fetchers. |
Which Remix packages are impacted?
remix
(Remix core)create-remix
@remix-run/architect
@remix-run/cloudflare-workers
@remix-run/dev
@remix-run/express
@remix-run/netlify
@remix-run/node
@remix-run/react
@remix-run/serve
@remix-run/server-runtime
@remix-run/vercel
What version of Remix are you using?
1.1.1 (1.0.6 also)
What version of Node are you using? Minimum supported version is 14.
16
Steps to Reproduce
Expected Behavior
The document shouldn't reload
Actual Behavior
The document is reloading!
Whether I call
load
from a combobox input or simply on mount in auseEffect
, the whole document reloads.I've added a default export to the route, and also removed it, thinking maybe it had to do with our resource routes, but in both cases it reloads.
It might have something to do with our auto
window.reload
if an asset isn't found and maybe my build hashes got out of whack? Not sure yet.The text was updated successfully, but these errors were encountered: