Skip to content

feat(hono): Extend peer dependency range#21550

Merged
chargome merged 1 commit into
developfrom
cg/hono-peer-deps
Jun 15, 2026
Merged

feat(hono): Extend peer dependency range#21550
chargome merged 1 commit into
developfrom
cg/hono-peer-deps

Conversation

@chargome

Copy link
Copy Markdown
Member
  • Extend optional peer deps to 2.x
  • Move the e2e test to @hono/node-server@2, v1 is covered in integration tests

@chargome chargome self-assigned this Jun 15, 2026
@chargome chargome requested a review from a team as a code owner June 15, 2026 13:29
@chargome chargome requested review from nicohrubec and s1gr1d and removed request for a team June 15, 2026 13:29
"peerDependencies": {
"@cloudflare/workers-types": "^4.x",
"@hono/node-server": "^1.x",
"@hono/node-server": "^1.x || ^2.x",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The peerDependencies range for @hono/node-server allows installing v2, which requires Node.js v20+, on projects using Node.js v18, causing runtime failures.
Severity: HIGH

Suggested Fix

To prevent runtime failures on Node.js v18, either update @sentry/hono's engines field to require Node.js v20+, or restrict the @hono/node-server peer dependency to ^1.x to ensure only compatible versions are installed.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/hono/package.json#L99

Potential issue: The `package.json` for `@sentry/hono` specifies a Node.js engine
requirement of `>=18`. However, it defines an optional peer dependency on
`@hono/node-server` with a version range of `^1.x || ^2.x`. Since version 2 of
`@hono/node-server` requires Node.js v20+, a user on a Node.js v18 environment could
inadvertently install this incompatible version. This will lead to a runtime failure
when the application attempts to import from `@hono/node-server`, as the package is not
compatible with Node.js v18.

Also affects:

  • dev-packages/e2e-tests/test-applications/hono-4/package.json:21~21

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional peer dep, that is fine. we'll bump to 20 in the next sdk major

@chargome chargome merged commit 94a90aa into develop Jun 15, 2026
50 checks passed
@chargome chargome deleted the cg/hono-peer-deps branch June 15, 2026 15:02
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.

2 participants