Scheduled Worker #3487
Replies: 1 comment 2 replies
|
Short version: nothing in Vike blocks this today. The type system already accepts your snippet, and Vike's build pipeline deliberately passes named exports through. The only open question is whether the last link in the chain, the Cloudflare Vite plugin's generated worker wrapper, preserves them into the deployed worker. That part I have not verified, and there is a two-minute way to find out. What I checked in source:
npx vitest run # after adding a test that imports your built entry
# or simply: npx wrangler dev, then curl the __scheduled endpoint
# wrangler dev exposes GET /__scheduled?cron=... to trigger the handlerIf the export survives, you are done; crons go in The zero-coupling alternative that works regardless: deploy a separate tiny cron Worker (its own script and Sources: |
Uh oh!
There was an error while loading. Please reload this page.
Is support for Cloudflare Workers scheduled handlers planned in Vike?
For example, I’d like to export a Worker compatible with both Vike’s Server type and Cloudflare’s scheduled events:
Is there an officially supported way to add this today, or is support for it planned?
All reactions