← Back to Dashboard
#9882 can't test cron triggers locally with assets
Recommendation:KEEP OPEN
Difficulty:medium
Reasoning:
2-3 separate bugs identified by maintainer affecting cron testing with assets/vite. Workarounds exist.
Suggested Action:
Fix miniflare, vite plugin, and SPA fallback for scheduled endpoints
Analysis Report
Issue Review: cloudflare/workers-sdk#9882
Summary
Cannot test cron triggers locally when using Workers with assets or the Vite plugin with redirected config.
Findings
- Created: 2025-07-08
- Updated: 2025-12-05
- Version: wrangler 4.24.0 → 4.61.0
- Component: wrangler, vite-plugin, miniflare
- Labels: bug, Workers + Assets
- Comments: 5
Key Evidence
- User followed docs to set up cron triggers with Vite+React project
- Both
/cdn-cgi/handler/scheduledand/__scheduledendpoints fail - Maintainer @emily-shen identified 2-3 separate bugs:
/cdn-cgi/handler/scheduledbroken for assets - miniflare tries to call scheduled handler on asset proxy worker instead of user worker/__scheduledwith--test-scheduledbroken for vite apps with redirected config - vite doesn't bundle the middleware that simulates scheduled handler- SPA
not_found_handlingcauses/__scheduledbrowser requests to fallback to index.html (curl works)
- Multiple workarounds documented by users:
- Build with wrangler first, use separate config for cron testing
- Add custom route handler to trigger cron logic
- Configure
run_worker_firstin assets binding
Recommendation
Status: KEEP OPEN
Reasoning: Multiple bugs identified by maintainer affecting cron trigger testing with assets and Vite plugin. Workarounds exist but are complex. These are real functionality gaps that block local testing of cron triggers in modern setups.
Action: Fix the three identified bugs:
- Fix miniflare to call scheduled handler on correct worker when assets are involved
- Fix vite plugin to bundle scheduled handler middleware
- Document or fix SPA fallback behavior for special endpoints
Suggested Comment
N/A - Maintainer already provided detailed analysis and workarounds.
Notes & Feedback (0)
No notes yet.