You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cf workers … API commands fail without workerd: workers module statically imports miniflare #390
cf workers scripts list and cf workers scripts search are Cloudflare API reads, but they fail when the platform workerd package isn't installed. Other API command groups, such as cf turnstile widgets list, work in the same shell. The workers command module statically imports a chunk that imports miniflare at the top level, and loading miniflare requires workerd.
Reproduction
cf 1.0.0-beta.18, Node 24, linux-arm64. It's a global npm install -g cf with the @cloudflare/workerd-linux-* package removed. That's how we keep a devcontainer image small: we ship cf for API work, and projects that need the local runtime get it from their own cf dev dependency.
mkdir /tmp/cf-repro && cd /tmp/cf-repro # no package.json, no config
export CLOUDFLARE_ACCOUNT_ID=<id> CLOUDFLARE_API_TOKEN=<token>
cf turnstile widgets list # makes the API call
cf workers scripts list # fails before any request
┌ Error
│ The package "@cloudflare/workerd-linux-arm64" could not be found, and is
│ needed by workerd.
└
containers-BtcOgwm5.mjs has import { getFreshSourceMapSupport, getNodeCompat } from "miniflare".
miniflare loads workerd at import time.
local-runtime-*.mjs is already loaded with a dynamic import(), and the turnstile module has no static path to miniflare.
Suggested fix
Load miniflare lazily in the containers code: a dynamic import("miniflare") where getFreshSourceMapSupport and getNodeCompat are used, as local-runtime already does. API-only subcommands would then not need workerd.
Activity
petebacondarwin commentedon Nov 4, 2026
Fixed via cloudflare/workers-sdk#16623
Will be released in 1.0.0-beta.28