Skip to content

@fedify/cfworkers: support @cloudflare/workers-types v5.x in peerDependencies #1255

Description

@codybrom

@fedify/cfworkers 2.4.1 (and the current dev builds) declares a peer dependency on @cloudflare/workers-types@^4.20260511.1. Cloudflare stopped publishing v4 at 4.20260702.1, and latest is now 5.x. The current version of wrangler (4.147.0) declares an optional peer on @cloudflare/workers-types@^5.20261001.1, so npm can't install @fedify/cfworkers alongside wrangler without --legacy-peer-deps or an overrides entry pinning workers-types back to v4.

Reproduction

npm init -y
npm install @fedify/fedify@2.4.1 @fedify/cfworkers@2.4.1 wrangler@4.147.0
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error Found: @cloudflare/workers-types@4.20260702.1
npm error   peer @cloudflare/workers-types@"^4.20260511.1" from @fedify/cfworkers@2.4.1
npm error Could not resolve dependency:
npm error Conflicting peer dependency: @cloudflare/workers-types@5.20261005.1
npm error   peerOptional @cloudflare/workers-types@"^5.20261001.1" from wrangler@4.147.0

Installing @cloudflare/workers-types@5 directly instead of wrangler fails the same way.

Proposed fix

Widen the peer range to accept v5, e.g. ^4.20260511.1 || ^5.20260511.1. The peer currently comes from the "@cloudflare/workers-types": ^4.20260511.1 entry in the pnpm catalog (pnpm-workspace.yaml), via "catalog:" in packages/cfworkers/package.json. So the fix is either to bump that catalog entry or to give the peer its own range. pnpm only warns on peer conflicts, so the workspace probably doesn't hit this, but npm fails outright.

The v5 types appear to work as-is. With --legacy-peer-deps, this typechecks with zero errors against both @cloudflare/workers-types@4.20260702.1 and @5.20261005.1 (TypeScript 6.0.3, @fedify/* 2.4.1):

import { WorkersKvStore, WorkersMessageQueue } from '@fedify/cfworkers';
import type { KvStore, MessageQueue } from '@fedify/fedify';

declare const kv: KVNamespace;
declare const queue: Queue;
const store: KvStore = new WorkersKvStore(kv);
const mq: MessageQueue = new WorkersMessageQueue(queue);
export { mq, store };
{
  "compilerOptions": {
    "target": "ESNext",
    "lib": ["ESNext"],
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "noEmit": true,
    "types": ["@cloudflare/workers-types"]
  },
  "files": ["check.ts"]
}

Activity

  1. added theissue type on Oct 6, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. dahlia commented on Oct 8, 2026

    @dahlia
    Member

    Fixed in Fedify 2.0.32, 2.1.28, 2.2.17, 2.3.12, and 2.4.2.

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

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions