~/adventure-log/2026/09/from-astro-to-emdash-part3
TechThis page was translated from the original by AI.

Migrating from Astro to EmDash: Pitfalls (Part 3)

After moving from Astro to EmDash, the admin panel ended up with two publication date fields, and scheduled publishing never fired. This post covers how to remove the extra publication date, configure a Cron Trigger in wrangler.jsonc, and add a scheduled handler so scheduled publishing actually works.

Published
Reading time
2 min
Tags
AstroCloudflare
After the hard work in the previous two posts, we can now publish articles from the EmDash admin panel. But since we migrated from Astro, there's some legacy baggage—or just things that aren't quite right—that we need to clean up.

Duplicate publication dates

double-publish-date.webp

As you can see in the screenshot, the Publication date at the bottom is the pubDate value from when we used Astro to write static MDX blog posts. But on the right, EmDash has its own Publish date value—we only need to keep one of them. We'll keep EmDash's built-in one and remove the Publication date below.

The fix is simple: go to Content Types → Post , find publication date , and click delete.

Of course, I won't go into the code changes here. Claude Code can handle that easily.

post-custom-fields.png

Scheduled publishing didn't work

There's still one issue: when I schedule a post, it doesn't actually publish at the specified time. But thinking about it, that makes sense—I never set up the relevant Cron, so of course scheduled publishing wouldn't fire.

post-schedule-failed.png

The fix is straightforward too. Refer to the official docs and add the following config to the wrangler.jsonc file:

plaintext
{
    "main": "./src/worker.ts",
    "triggers": { "crons": ["* * * * *"] },
}
plaintext
# ./src/worker.ts

/**
 * Cloudflare Worker entry.
 *
 * The Astro adapter's own entry only exports `fetch`, so nothing drives
 * EmDash's scheduled work in production: the Cloudflare build sets
 * `createScheduler = null` and expects a Cron Trigger to call
 * `runScheduledTasks()` through a `scheduled()` handler. This re-export adds
 * that handler to the same Worker, which is what `emdash doctor` checks for.
 * Without it, scheduled posts stay `scheduled` past their publish time.
 */
export { default, PluginBridge } from "@emdash-cms/cloudflare/worker";

Then push and deploy. If you see a config like the one below, it means we've set it up successfully, and scheduled publishing will work as expected!

triggers.png

You got a collectible· Item get

No.028

Ancient Gear

Common

Region
Tech Highlands
Found near
Astro · Cloudflare
Discovered
Journey
2 min · 1 traveller so far

Earned by finishing this quest. The more travellers who read it, the rarer it grows.

Epona
Written byEpona

There's nothing wrong with having a little fun

x.com/simura_epona

RelatedNearby quests

Loading comments…