Skip to content

Server function not working properly #1229

Answered by gbj
Neighborkid01 asked this question in Q&A
Discussion options

You must be logged in to vote

Just adding for the sake of knowledge and for any future readers: the reason it worked on initial load but not subsequently was that, during server-side rendering, server functions are actually just called directly on the server, as functions. The "registration" process is required to provide each one with a distinct URL that the server knows about, but these separate server function URLs are only used when a server function is called from the browser, not when it's called on the server (i.e., during server rendering.) So a server function worked properly on initial SSR of the page, but not if you navigated to it again from the browser.

As I mentioned, this registration is now done automa…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Neighborkid01
Comment options

@Neighborkid01
Comment options

@gbj
Comment options

@gbj
Comment options

Answer selected by Neighborkid01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants