Clean up the serverFunctions.onError JSDoc - #1
Closed
adipascu wants to merge 1 commit into
Closed
Conversation
adipascu
force-pushed
the
docs/server-fn-error-handler-jsdoc
branch
4 times, most recently
from
July 29, 2026 15:35
3b80c45 to
b695aa0
Compare
serverFunctions.onError contract for consumersserverFunctions.onError JSDoc
adipascu
force-pushed
the
docs/server-fn-error-handler-jsdoc
branch
from
July 29, 2026 15:37
b695aa0 to
cbe53fc
Compare
serverFunctions.onError JSDocserverFunctions.onError JSDoc
adipascu
force-pushed
the
docs/server-fn-error-handler-jsdoc
branch
3 times, most recently
from
July 29, 2026 15:50
ad9818f to
a9ef547
Compare
adipascu
force-pushed
the
docs/server-fn-error-handler-jsdoc
branch
from
July 29, 2026 15:51
a9ef547 to
c98aff2
Compare
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.
Follow-up review of the JSDoc added in solidjs#2262. Docs only, no behavior change.
SolidStartOptions.serverFunctionsThe summary still said the option only controls "which files are processed as server functions", which stopped being true once
onErrorwas added alongsidefilter. It now covers both.serverFunctions.onErrorRewritten around what a consumer has to know to write a handler. Four things were missing:
Responsecan arrive as the thrown value. A thrownredirect()reaches the handler before thex instanceof Responsebranch inhandleServerFunction, so a handler that replaces everything it sees turns every thrown redirect into an error. Nothing said so, and it is the easiest way to break an app with this option.applyServerFunctionErrorHandlercalls the export and passes the result straight on, so anasynchandler does not do what it looks like it does.cloneServerReferenceproxy and throws straight to its caller, and API routes never touch this path at all. Worth stating for anyone wiring this up as their error reporting hook.Also documents that
nullkeeps the original alongsideundefined, matching?? thrown, and states theResponsereturn case that previously only the tests knew about.Dropped the paragraph explaining why the handler is named by module path instead of registered at runtime. That is design rationale for maintainers, not something a consumer needs while writing
vite.config.ts.ServerFunctionErrorHandlerThis is the type consumers import from
@solidjs/start/serverwhen writing their handler, and it had no doc at all. Now carries@param,@returns, and a worked@example, mirroring the shape of theserialization.pluginsdocs infns/plugins.ts. The example passesResponsecontrol flow through, so copying it does not break redirects./** @internal */Removed. It was the only occurrence in the repo,
packages/start/tsconfig.jsondoes not setstripInternal, and there is no API Extractor or TypeDoc in the pipeline, so it stripped nothing.applyServerFunctionErrorHandleris not re-exported from any public entry point, so it is unreachable for consumers either way.apps/tests/src/server-fn-error.tsPunctuation, and refers to the sibling as
src/seroval-plugins.tsthe wayconfig/index.tsdoes. The rationale in this file is kept: it is a maintainer-facing fixture, and the note about why returningundefinedmatters would otherwise be broken silently.oxfmt --checkpasses on all three files.