Skip to content

[wrangler][C3] Use qwik add cloudflare-workers instead of cloudflare-pages#12569

Open
MattieTK wants to merge 1 commit intomainfrom
mattietk/fix-qwik-adapter
Open

[wrangler][C3] Use qwik add cloudflare-workers instead of cloudflare-pages#12569
MattieTK wants to merge 1 commit intomainfrom
mattietk/fix-qwik-adapter

Conversation

@MattieTK
Copy link
Member

@MattieTK MattieTK commented Feb 16, 2026

Fixes https://jira.cfdata.org/browse/DEVX-2443


Use the correct Qwik adapter (cloudflare-workers) when targeting Workers, instead of running the Pages adapter and cleaning up after it.


Both the wrangler autoconfig (packages/wrangler/src/autoconfig/frameworks/qwik.ts) and the C3 Workers template (packages/create-cloudflare/templates/qwik/workers/c3.ts) were running qwik add cloudflare-pages even when targeting Cloudflare Workers. This caused the wrong adapter directory structure to be scaffolded (adapters/cloudflare-pages/ instead of adapters/cloudflare-workers/), and required post-hoc cleanup of Pages-specific files like _routes.json and manual creation of .assetsignore.

Qwik provides a dedicated cloudflare-workers adapter (qwik add cloudflare-workers) that generates the correct Workers configuration out of the box:

  • adapters/cloudflare-workers/vite.config.ts (correct adapter directory)
  • wrangler.jsonc with main and assets fields
  • public/.assetsignore with the correct entries
  • Workers-appropriate package.json scripts

Changes

packages/wrangler/src/autoconfig/frameworks/qwik.ts:

  • qwik add cloudflare-pagesqwik add cloudflare-workers
  • Added --skipConfirmation=true to skip Qwik's interactive prompt
  • Removed addAssetsIgnoreFile() function (the adapter now generates this)
  • Removed unused writeFile import
  • Updated configurationDescription string

packages/create-cloudflare/templates/qwik/workers/c3.ts:

  • qwik add cloudflare-pagesqwik add cloudflare-workers
  • Added --skipConfirmation=true
  • Removed removeFile("./public/_routes.json") (the workers adapter doesn't generate this)
  • Removed unused removeFile import

packages/create-cloudflare/templates/qwik/pages/c3.ts:

  • Added --skipConfirmation=true for consistency

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: The Qwik E2E tests are currently quarantined due to upstream eslint compatibility issues. The autoconfig unit tests that ran (18/18) all pass. The change is a direct swap of the adapter name argument with cleanup of now-unnecessary workarounds.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This aligns the tooling with Qwik's existing documentation for the cloudflare-workers deployment target.

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 83d89ef

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

@claude
Copy link
Contributor

claude bot commented Feb 16, 2026

Claude finished @MattieTK's task —— View job


Changeset Review

✅ All changesets look good

The changeset file .changeset/fix-qwik-adapter.md follows all the guidelines:

  1. Version Type: patch for both wrangler and create-cloudflare is appropriate for this bug fix
  2. Changelog Quality: The description is clear and well-structured, explaining both the problem and the solution
  3. Markdown Headers: No h1/h2/h3 headers present
  4. Analytics: No analytics changes in this PR
  5. Format: Follows the recommended format with a clear title and detailed body explaining the issue and fix

The changeset properly covers both affected packages and provides good context about why the change was necessary.


async function addAssetsIgnoreFile(projectPath: string) {
const toAdd = ["_worker.js", "_routes.json", "_headers", "_redirects"];

await writeFile(
Copy link
Member Author

Choose a reason for hiding this comment

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

assets ignore gets added by the qwik adapter already

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12569

wrangler

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

commit: 83d89ef

@MattieTK MattieTK marked this pull request as ready for review February 16, 2026 08:36
@MattieTK MattieTK requested a review from a team as a code owner February 16, 2026 08:36
Copy link
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 3 additional findings.

Open in Devin Review

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @MattieTK 🙂

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 16, 2026
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Note that the qwik C3 tests are all quarantined right now, so they are not being tested in CI!

@dario-piotrowicz
Copy link
Member

Note that the qwik C3 tests are all quarantined right now, so they are not being tested in CI!

yeah you're right... 😓 it's also difficult to check wether these changes are valid given the fact that the quick CLI currently produces borken apps 😓

…Workers targets

Switch both the wrangler autoconfig and C3 Workers template for Qwik
from 'qwik add cloudflare-pages' to 'qwik add cloudflare-workers'.

The cloudflare-workers adapter generates the correct Workers-specific
scaffolding (adapters/cloudflare-workers/, .assetsignore, wrangler.jsonc
with main + assets fields), removing the need for post-hoc cleanup of
Pages-specific files.

Also adds --skipConfirmation=true to all qwik add invocations so the
interactive prompt is skipped in automated contexts.
@MattieTK MattieTK force-pushed the mattietk/fix-qwik-adapter branch from 2788057 to 83d89ef Compare February 19, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

3 participants

Comments