Skip to content

fix(workers): stop cf deploy mis-detecting froq-api as Hydrogen - #38

Merged
0froq merged 1 commit into
mainfrom
cursor/cf-deploy-framework-detect-1169
Oct 26, 2026
Merged

0froq merged 1 commit into
mainfrom
cursor/cf-deploy-framework-detect-1169

Conversation

@0froq

@0froq 0froq commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Problem

Workers Builds production for froq fails on pnpm exec cf deploy after the #37 vp-config squash (414e360). pnpm generate succeeds; deploy dies immediately with:

multiple frameworks were found: PNPM + Hydrogen workers/froq-api, PNPM + Nuxt

cf still runs @netlify/build-info framework detection even when cloudflare.config.ts exists. Hydrogen lists vite.config.ts as a config file and treats a config-only match as a detection. #37 added a root vite.config.ts for Vite+ lint/fmt; from workers/froq-api that file is found by findUp, so the API package is reported as Hydrogen. Nuxt at the repo root is the other hit. In CI both are “known” frameworks, so autoconfig throws. Product code is unchanged; lig does not have a workers/ package, which is why the same vite.config.ts pattern is safe there.

Fix

Do not revert #37. Declare vite as a workers/froq-api devDependency (remapped by the existing vite@* → vite-plus-core override). Vite then outranks the Hydrogen false positive on that package. Cloudflare autoconfig treats Vite as auxiliary when paired with Nuxt, so root site deploy stays Nuxt + Wrangler assets (dist/). froq-api itself still deploys with pnpm --dir workers/froq-api deploy / Wrangler.

Verification

No Cloudflare credentials in this environment. Checks that prove the auto-detect clash is gone:

  • Reproduced the production error locally: CI=true pnpm exec cf deploy --dry-run on main → Hydrogen + Nuxt.
  • Hid root vite.config.ts → detection passed and cf delegated to Wrangler (then failed only on missing dist/). Restored the file.
  • With this change and a stub dist/index.html: CI=true pnpm exec cf deploy --dry-run → Wrangler build + “Dry run complete”, no framework error.
  • pnpm --dir workers/froq-api exec wrangler deploy --dry-run still packages the API worker.
  • pnpm install --frozen-lockfile succeeds.

Residual risk: a real deploy still needs Workers Builds credentials and a full pnpm generate dist/. Detection now resolves to a single site framework (Nuxt); if another known non-auxiliary framework is added to the workspace, autoconfig could fail again. vite is unused by froq-api runtime — documented in wrangler.toml.

Open in Web Open in Cursor 

Root vite.config.ts from the vp-config migration is visible from
workers/froq-api, so Cloudflare autoconfig reports Hydrogen + Nuxt and
fails in Workers Builds CI. Declaring vite on the API package makes Vite
outrank that false positive; cf then treats Vite as auxiliary and keeps
Nuxt as the site framework.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 9315564 2026-10-26T18:13:21.569Z View logs ↗

@0froq
0froq marked this pull request as ready for review October 26, 2026 18:51
@0froq
0froq merged commit 17ba63e into main Oct 26, 2026
1 of 3 checks passed
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