You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calling server function within another server function inside loader alters parameters unexpectedly #1866
When calling a server function inside another server function, the parameters get altered unexpectedly, causing the outer function to receive modified parameters. This issue prevents the function from being reusable as intended.
The createServerFn wrapper seems to be adding extra data to the parameters, such as method, payload, and requestInit. This behavior interferes with the intended parameter structure, making it difficult to reuse the server function properly.
changed the title [-]Calling server function within another server function alters parameters unexpectedly[/-][+]Calling server function within another server function inside loader alters parameters unexpectedly[/+]on Jul 1, 2024
Solves my issue and doesn't cause issues with other server functions even when called in the react component. So I'm not sure why it's being called with those extra args.
Activity
[-]Calling server function within another server function alters parameters unexpectedly[/-][+]Calling server function within another server function inside loader alters parameters unexpectedly[/+]jadedevin13 commentedon Jul 1, 2024
I found that simply replacing the following lines
router/packages/start/src/client/createServerFn.ts
Lines 85 to 92 in bf52d5a
with
Solves my issue and doesn't cause issues with other server functions even when called in the react component. So I'm not sure why it's being called with those extra args.