Skip to content

Fix autoconfig failing on waku projects that use hono#13112

Merged
petebacondarwin merged 1 commit intomainfrom
dario/autoconfig-waku-hono
Mar 29, 2026
Merged

Fix autoconfig failing on waku projects that use hono#13112
petebacondarwin merged 1 commit intomainfrom
dario/autoconfig-waku-hono

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

@dario-piotrowicz dario-piotrowicz commented Mar 29, 2026

Waku has a tight integration with Hono, causing both to be detected simultaneously and triggering a "multiple frameworks found" error. Hono is now filtered out when Waku is also detected.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: already being tested by the (currently failing) C3 e2es

Note

#13113 also adds a unit test for the changes in this PR
(see: https://github.com/cloudflare/workers-sdk/pull/13113/changes#r3006383619)

  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner March 29, 2026 14:20
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 29, 2026

🦋 Changeset detected

Latest commit: 82ab129

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 29, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@github-actions
Copy link
Copy Markdown
Contributor

✅ All changesets look good

@dario-piotrowicz dario-piotrowicz removed the request for review from emily-shen March 29, 2026 14:21
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 29, 2026

Let me do a final review of the logic. The code change adds a new branch inside the settingsForOnlyKnownFrameworks.length === 2 block:

if (frameworkIdsFound.has("waku") && frameworkIdsFound.has("hono")) {
    return settingsForOnlyKnownFrameworks.find(
        ({ framework }) => framework.id === "waku"
    );
}

One concern: .find() can return undefined, and the function's return type is DetectedFramework | undefined. If settingsForOnlyKnownFrameworks somehow doesn't contain a waku entry (though it should given the has("waku") check above), this would return undefined, which would cause the caller to treat it as "no framework detected." But this is essentially impossible because frameworkIdsFound is built from settings which is a superset of settingsForOnlyKnownFrameworks, and waku is a known framework ID, so if it's in settings it must also be in settingsForOnlyKnownFrameworks. This is safe.

Actually wait - there's a subtle issue. frameworkIdsFound is built from settings (all frameworks), not settingsForOnlyKnownFrameworks (only known frameworks). If we're inside the settingsForOnlyKnownFrameworks.length === 2 block, there are exactly 2 known frameworks. But the frameworkIdsFound check uses settings which may have more entries. This means frameworkIdsFound.has("waku") && frameworkIdsFound.has("hono") checks whether waku and hono are in settings (which could contain unknown frameworks too). Since waku and hono are both known framework IDs, if they're in settings, they'd also be in settingsForOnlyKnownFrameworks. So if both are present and there are exactly 2 known frameworks, those 2 must be waku and hono. The logic is correct.

This is a clean, well-targeted fix. The changeset is properly formatted. The code follows the existing pattern for framework disambiguation (same approach as the vite handling). No logic bugs, no security issues, no backward compatibility concerns.

LGTM

github run

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 29, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13112

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13112

miniflare

npm i https://pkg.pr.new/miniflare@13112

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13112

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13112

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13112

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13112

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13112

wrangler

npm i https://pkg.pr.new/wrangler@13112

commit: 82ab129

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 29, 2026
@petebacondarwin petebacondarwin merged commit 9aad27f into main Mar 29, 2026
59 of 63 checks passed
@petebacondarwin petebacondarwin deleted the dario/autoconfig-waku-hono branch March 29, 2026 20:53
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 29, 2026
This was referenced Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants