sveltejs / sveltejs/kit

`RemoteFunction.enhance` callback type mismatch

Open
#14,408 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

types / typescript
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

The documentation shows using an async callback but the types don't

The callback passed into enhance should return (Promise<void> | void).

Reproduction
Logs
-
System Info
-
Severity

annoyance

Additional Information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect packages/kit/types/index.d.ts around lines 1695-1702 and compare the callback type with the async usage shown in the linked form-enhance documentation. Done means the enhance callback type accepts both void and Promise, matching the documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.