Skip to content

Default handleError doesn't say which remote function failed schema validation #17418

Description

@filiabel

Describe the problem

A schema validation failure in a remote function logs the following by default:

Remote function schema validation failed: [ { message: 'Invalid type: Expected string but received undefined', ... } ]

The log doesn't say which remote function failed, so in an app with many queries it's hard to trace.

Writing your own handleError is the usual way around this, but it would be nice to have it dealt with by default.

Describe the proposed solution

Include the remote function name in log messages, so the default is enough to find the failing function.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Activity

  1. Aman13sh commented on Oct 13, 2026

    @Aman13sh

    I’d like to work on this,

  2. teemingc commented on Oct 13, 2026

    @teemingc
    Member

    Ideally, we'd locate the file and line the remote function was called, the file its declared in, the name of the remote function, etc. while stripping internals

  3. added theissue type on Oct 13, 2026
  4. Aman13sh commented on Oct 13, 2026

    @Aman13sh

    Thanks! I’ll start with the remote function’s name and the file it’s declared in, since that looks available where validation happens. I’ll then look into whether the call-site file and line can be surfaced, and if that needs a bigger change I’ll check back here first. Does that sound good?

  5. Aman13sh commented on Oct 20, 2026

    @Aman13sh

    Hi @teemingc , I've opened #17495 covering the function name and the file it's declared in. Both are passed to handleError as remote: { name, file } and included in the default log, e.g. Remote function getUser (src/routes/users.remote.js) schema validation failed: ....

    Before I look at the call site, a few questions so I don't go in the wrong direction:

    1. For server-side calls, is the first stack frame outside Kit/node_modules (file:line) what you had in mind?
    2. When a remote function is called from the browser, the server can't see the client call site. Should we skip it in that case?
    3. Should call-site info be dev-only?
    4. Is exposing remote on the public handleError input okay, or should it stay internal to the default logger?

    Happy to add the call site to this PR or as a follow-up, whichever you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions