cf build warns about workspace auto-configuration with an explicit Bun workspace Worker config

オープン
#472 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bun, typescript, vite
領域
build-system, cli

調査の方向性

Start with the lockfile detection that emits the 'No lock file has been detected' message in the cf build code path, and check whether it only looks in the current working directory. Reproduce with the workspace layout from the issue (root bun.lock, worker in packages/worker, explicit cloudflare.config.ts and vite.config.ts) and run cf build --mode production. Done when the warning is suppressed for explicitly configured builds and still appears when the limitation really applies.

索引モデルが issue の本文から書いたものです。

説明

Summary of the issue

cf build prints an auto-configuration workspace limitation warning for an explicitly configured Worker inside a Bun workspace. The workspace has a valid root bun.lock, and the Worker declares cf, Vite and the Cloudflare Vite plugin in its own package manifest. The build itself succeeds.

The message says no lock file was detected in the current working directory, which is true for this layout, but it is unclear why auto-configuration limitations apply when cloudflare.config.ts and vite.config.ts are already provided.

Expected behaviour

Recognize the workspace root lockfile and distinguish an explicitly configured build from a build that relies on workspace auto-configuration. Keep the warning when the limitation actually applies.

Version of cf used

1.0.0-beta.26. Also reproduced with 1.0.0-beta.24.

System information and package versions

envinfo output, with local executable paths and the transient memory reading omitted:

System: macOS 27.2, Apple M3 arm64, zsh 5.9
Binaries: Node 26.13.0, npm 11.20.0, Bun 1.4.4, Yarn 4.18.1, pnpm 12.16.1, Deno 2.9.8
npmPackages: @cloudflare/vite-plugin 2.0.0-beta.v.5, cf 1.0.0-beta.26

Vite is 8.3.5.

Reproduction

Create a workspace root package.json:

{"name":"cf-bun-workspace-repro","private":true,"workspaces":["packages/*"]}

Create packages/worker/package.json:

{"name":"example-worker","private":true,"type":"module","devDependencies":{"@cloudflare/vite-plugin":"2.0.0-beta.v.5","cf":"1.0.0-beta.26","vite":"8.3.5"}}

Create packages/worker/cloudflare.config.ts:

import { defineConfig } from 'cf/config'
export default defineConfig({ worker: { name: 'example-worker', compatibilityDate: '2025-07-01', entrypoint: 'src/index.ts' } })

Create packages/worker/vite.config.ts:

import { cloudflare } from '@cloudflare/vite-plugin'
import { defineConfig } from 'vite'
export default defineConfig({ plugins: [cloudflare()] })

Create packages/worker/src/index.ts:

export default { fetch: () => new Response('ok') }

Run bun install at the root, then run ./node_modules/.bin/cf build --mode production from packages/worker. The root has bun.lock; the worker directory has no separate lockfile. node ./node_modules/vite/bin/vite.js build --mode production from the same worker directory succeeds without the warning.

Relevant error logs

No lock file has been detected in the current working directory. This might indicate that the project is part of a workspace. Auto-configuration of projects inside workspaces is limited. See https://developers.cloudflare.com/workers/framework-guides/automatic-configuration/#workspaces
Build complete

No deployment was performed.

主要言語
TypeScript
スター
960
フォーク
62
平均マージ
19時間 7分
マージ済み PR(30日)
193

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudflare/cf のほかの issue

cloudflare/cf の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。