Add experimental badge-test worker#828
Conversation
|
| { | ||
| "$schema": "node_modules/wrangler/config-schema.json", | ||
| "name": "badge-test", | ||
| "main": "src/index.js", |
There was a problem hiding this comment.
🔴 Test worker has no source code, so deployment fails
The worker is configured to start from an entry file ("main": "src/index.js" at badge-test/wrangler.jsonc:8) that does not exist anywhere in the project, so building, running, or deploying the worker fails immediately.
Impact: Anyone clicking the Deploy to Cloudflare button (or running wrangler dev/wrangler deploy) gets an error because the worker has no code to run.
Missing entry point referenced by wrangler config
badge-test/wrangler.jsonc:8 sets "main": "src/index.js", but the badge-test/ directory contains no src/ folder and no index.js. The full file listing is only config files (.editorconfig, .gitignore, .prettierrc, README.md, package-lock.json, package.json, vitest.config.js, wrangler.jsonc). Wrangler resolves main relative to the config file and will fail with an entry-point-not-found error during wrangler dev and wrangler deploy (the scripts defined at badge-test/package.json:6-8). The Deploy to Cloudflare button in badge-test/README.md:1 therefore cannot succeed. Additionally "test": "vitest" has no test files to run.
Prompt for agents
The badge-test worker's wrangler.jsonc sets "main": "src/index.js", but no src/index.js (or any Worker source file) exists in the badge-test/ directory. As a result, wrangler dev, wrangler deploy, and the Deploy to Cloudflare button will all fail because there is no entry point to build. Add a minimal Worker entry file at badge-test/src/index.js that exports a default fetch handler, so the worker can actually be built and deployed. Optionally also add a corresponding test file since package.json defines a "test": "vitest" script that currently has nothing to run.
Was this helpful? React with 👍 or 👎 to provide feedback.
Testing to see if multiple deploy-to-cloudflare buttons can exist in a repo