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
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.
The text was updated successfully, but these errors were encountered:
jadedevin13
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
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.
Describe the bug
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.
Your Example Website or App
N/A
Steps to Reproduce the Bug or Issue
createServerFn
:Call the
serverFn
function with the following parameters:Observe the console logs for
params
withinserverFn
:Expected output:
Actual output:
Expected behavior
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.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: