remix icon indicating copy to clipboard operation
remix copied to clipboard

`useFetcher` not working for routes that has runtime `nodejs`

Open joeykamsteeg opened this issue 1 year ago • 5 comments

I have encountered an issue while using useFetcher in Remix. When utilizing useFetcher for a route configured to run on the Edge Runtime, the route is successfully called. However, when the route is set to run on the nodejs runtime, useFetcher returns a 404 Not Found error.

joeykamsteeg avatar Aug 15 '24 18:08 joeykamsteeg

Can you put together a reproduction repo so that we can take a closer look?

TooTallNate avatar Aug 15 '24 19:08 TooTallNate

@TooTallNate Sure, I'm on it!

joeykamsteeg avatar Aug 15 '24 19:08 joeykamsteeg

I have made a reproduction repo and running on Vercel, their is a strange twist. In my personal project the node function is not working with useFetcher but in this reproduction repo the Edge function is not working 😅 but the issue is the same.

Extra information: If you try to press the buttons on the live version, you see that only the NodeJS action is popup up in the Network in the inspector. I'm not sure if this is related to 'Single Fetch'

Repo: https://github.com/joeykamsteeg/remix-usefetcher-vercel-issue Live: https://remix-usefetcher-vercel-issue.vercel.app

joeykamsteeg avatar Aug 15 '24 19:08 joeykamsteeg

I have setup a new branch without singleFetch and it seems an issue while using Single Fetch

live: https://remix-usefetcher-vercel-issu-git-c14bdc-joey-kamsteegs-projects.vercel.app/

joeykamsteeg avatar Aug 15 '24 19:08 joeykamsteeg

Looks similar to https://github.com/remix-run/remix/issues/10494. Not sure if this is a pure Vercel or a remix issue. It smells more like a design issue in remix, when single fetch and lazyRouteDiscovery is turned on.

styxlab avatar Feb 25 '25 09:02 styxlab