Skip to content

fix(migrate): add account_id to generated wrangler.jsonc template #431

Description

@JonasJesus42

Problem

The migration script's generateWranglerConfig in packages/blocks-cli/scripts/migrate/phase-scaffold.ts does not include account_id in the generated wrangler.jsonc. Without it, wrangler deploy targets the deploying user's default CF account instead of the deco-cx account — causing Worker-to-Worker fetches to deco-otel-ingest.deco-cx.workers.dev to return 404.

This was observed on miess-01-tanstack: every POST to the otel-ingest endpoint returned 404, while other sites (casaevideo, lebiscuit, baggagio) that had account_id pinned got 200 OK. Fix was applied manually via PR #56 on that site.

Fix

Add account_id: "c95fc4cec7fc52453228d9db170c372c" to the object returned by generateWranglerConfig in packages/blocks-cli/scripts/migrate/phase-scaffold.ts, so every newly migrated site already has the correct account pinned from day one.

Why this account_id

c95fc4cec7fc52453228d9db170c372c is the deco-cx Cloudflare account that hosts deco-otel-ingest and deco-otel-tail. Both Worker-to-Worker fetches and tail_consumers bindings require in-account routing to resolve correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions