Skip to content

fix: accept fastify 5.x in the static-server logging plugin - #633

Merged
aversini merged 1 commit into
mainfrom
fix/static-server-logs-fastify5
Aug 3, 2026
Merged

aversini merged 1 commit into
mainfrom
fix/static-server-logs-fastify5

Conversation

@aversini

@aversini aversini commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

static-server --logs has been broken since the package moved to fastify 5.x. The fastify-simple-logger plugin still declared fastify: "4.x" in its fastify-plugin metadata, so the version check failed at boot and the server exited without ever serving:

fastify-plugin: fastify-simple-logger - expected '4.x' fastify version, '5.11.2' is installed

Every other flag works — only --logs is affected.

Fix

One line: widen the declared range to 5.x, matching what the package actually pins.

Why it went unnoticed

packages/static-server has no test script and no tests (lerna runs test for 12 of 14 packages, this is one of the two skipped), so nothing exercised the flag.

Verification

Built and ran the real binary:

$ node dist/server.js <dir> --port 8801 --logs
[...]: Server listening at http://127.0.0.1:8801
[...]: GET / 200
[...]: GET /nope 404

Before this change the same command printed the version-check error and served nothing. Full pnpm build + pnpm lint pass.

Note for later

Unrelated, but fastify now warns that disableRequestLogging (used in server.ts) is deprecated and goes away in fastify 6 — worth handling before that major.

🤖 Generated with Claude Code

https://claude.ai/code/session_016bnTX3dzc8eVeb6Qfm51hv

The fastify-simple-logger plugin still declared `fastify: "4.x"` in its
fastify-plugin metadata. static-server moved to fastify 5.x, so the version
check failed at boot and `static-server --logs` exited without serving:

    fastify-plugin: fastify-simple-logger - expected '4.x' fastify version,
    '5.11.2' is installed

Widen the declared range to 5.x, which is what the package pins.

The package has no test script, so nothing caught this. Verified by hand:
`static-server <dir> --logs` now boots and logs `GET / 200` / `GET /nope 404`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bnTX3dzc8eVeb6Qfm51hv
@aversini
aversini merged commit e519c25 into main Aug 3, 2026
5 checks passed
@aversini
aversini deleted the fix/static-server-logs-fastify5 branch August 3, 2026 22:50
@aversini aversini mentioned this pull request Aug 3, 2026
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