fix(ui): register slugify server function across adapters#17416
Merged
Conversation
The TanStack Start adapter dispatches server functions from sharedServerFunctions, which omitted slugify. Clicking the Slug field's regenerate button threw "Unknown Server Function: slugify" server-side (silently swallowed on the client). Next was unaffected as it registers slugify in its own handler list.
handleGenerate awaited the slugify server function with no error handling, so a failing dispatch (e.g. an unregistered handler or a thrown UnauthorizedError) was silently swallowed with no user feedback. Catch the rejection and show an error toast.
The Next.js adapter re-declared every server function instead of reusing sharedServerFunctions, so the two lists drifted — the cause of the missing slugify handler under TanStack. Spread the shared registry and declare only the RSC-only extras, so a handler added to the registry reaches both adapters.
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
jacobsfletch
enabled auto-merge (squash)
July 20, 2026 19:21
r1tsuu
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Next.js and TanStack Start server function adapters have drifted apart: each framework maintained its own lists independently, so a handler could exist on one adapter and be missing from the other, e.g.
slugifywithin the TanStack adapter.Within TanStack Start, the
slugifyserver function was missing from the registry. Any user-invoked slug regeneration would fail outright, throwing:The fix creates a unified source of truth. Both adapters now derive their handler list from
sharedServerFunctions, declaring only their RSC-only extras on top. A handler added once reaches every adapter, and the lists can't fall out of sync again.Also adds additional error handling at the component-level to provide the user with visual feedback.
In a follow-up PR, we should explore how to further prevent drift by removing the TanStack-specific server function wrappers.