Skip to content

Troubleshooting

Operation method returns before network access

Section titled “Operation method returns before network access”

Client input parsing happens first. Inspect the sanitized INPUT_VALIDATION_FAILED issues and pass the schema’s input type. Async refinements and transforms are supported.

The default operation access policy requires req.user. Anonymous denial is 401 and authenticated denial is 403. Add a narrow operation override for public routes; do not parse cookies, JWTs, or API keys inside the handler.

Confirm that Payload includes every returned endpoint and that client and server use the same basePath. The operation path is derived from the exact namespace keys. Do not include a query or hash in baseURL.

Register the complete result of createPayloadEndpoints, including its OPTIONS entries. Success and error responses use Payload’s headersWithCors, so verify Payload’s CORS configuration and the request origin.

The response must match the operation’s code, status, message, and data schema exactly. Unknown, malformed, non-JSON, or forged envelopes are deliberately downgraded. Throw the supplied handler factory instead of constructing a lookalike object.

Handlers return the output schema’s input shape, and that value must also be JSON-serializable. The client receives the output schema’s parsed shape. Return a wire-safe value rather than the transformed result.

timeoutPlugin requires a positive finite integer. It converts only operation transport timeouts. A caller-supplied abort remains the original abort, and native Payload SDK request failures are not converted to operation errors.

cms.payload is the native SDK instance and keeps native SDK semantics and error types. Inspect Payload SDK documentation for its request behavior; operation error handling applies only to cms.operations.