Skip to content

fix: type reconnectTimer as setTimeout return value#3820

Merged
bartlomieju merged 3 commits into
mainfrom
fix/dev-hmr-timer-type
May 26, 2026
Merged

fix: type reconnectTimer as setTimeout return value#3820
bartlomieju merged 3 commits into
mainfrom
fix/dev-hmr-timer-type

Conversation

@bartlomieju
Copy link
Copy Markdown
Contributor

The dev HMR client declares reconnectTimer as number, but the runtime
type of setTimeout's return value is a Timeout object, so deno check
now fails with TS2322: Type 'Timeout' is not assignable to type 'number'
at packages/fresh/src/runtime/client/dev_hmr.ts:32. This is blocking
every PR's type check job. Switching the annotation to
ReturnType<typeof setTimeout> keeps the declaration accurate without
committing to a specific runtime's timer type.

The runtime type of setTimeout's return value changed to a Timeout object,
so the explicit `number` annotation no longer type-checks. Using
`ReturnType<typeof setTimeout>` keeps the declaration accurate across
runtimes.
@bartlomieju bartlomieju merged commit 724879d into main May 26, 2026
9 checks passed
@bartlomieju bartlomieju deleted the fix/dev-hmr-timer-type branch May 26, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant