Skip to content

Fix legacy Payload build failures for climatemappedafrica/codeforafrica/charterafrica - #1509

Merged
kelvinkipruto merged 2 commits into
mainfrom
fix/legacy-payload-build-deps
Aug 20, 2026
Merged

Fix legacy Payload build failures for climatemappedafrica/codeforafrica/charterafrica#1509
kelvinkipruto merged 2 commits into
mainfrom
fix/legacy-payload-build-deps

Conversation

@kelvinkipruto

@kelvinkipruto kelvinkipruto commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Fix three legacy Docker builds (climatemappedafrica, codeforafrica, charterafrica) that have been failing on every push to main for months.

Fixes the Climate Mapped Africa | Deploy | DEV, Code for Africa | Deploy | DEV, and charterAFRICA | Deploy | DEV workflows.

Why

These three builds have each been failing on every run since well before this week — codeforafrica's and climatemappedafrica's last green run was #1461 on 2026-04-20, charterafrica's since #1409 on 2026-03-05.

The failures:

  • climatemappedafrica: next build fails with Cannot find module 'express' or its corresponding type declarations in server.ts. @types/express is already pinned in the workspace catalog but was never declared as a devDependency in this app.
  • codeforafrica / charterafrica: payload build fails with Cannot find module 'ajv'. @payloadcms/bundler-webpack peer-requires ajv@8.14.0, which nothing else in either app's dependency tree pulls in directly.

Both are the same class of bug as RoboShield's own @babel/preset-react issue (fixed in #1507): a dependency that used to resolve via hoisting elsewhere in the monorepo, silently relied on rather than declared, which stopped working at some earlier point and has stayed broken since.

What changed

  • Add @types/express (catalog) to climatemappedafrica's devDependencies.
  • Add ajv@8.14.0 to the shared pnpm-workspace.yaml catalog (used identically by both affected apps) and reference it from codeforafrica's and charterafrica's devDependencies.
  • Update pnpm-lock.yaml accordingly.

No application code changed — this only makes each app's own dependency graph explicit instead of relying on hoisting from elsewhere in the monorepo.

Validation

  • pnpm --filter climatemappedafrica build:next — compiles successfully (previously failed with the express type error).
  • pnpm --filter codeforafrica build-payload — exits 0 (previously failed with the ajv error).
  • pnpm --filter charterafrica build-payload — exits 0 (same ajv error).
  • ESLint passes on all changed files.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

…ca/charterafrica

RoboShield's Docker Bake migration (#1507) added @babel/preset-react to
apps/roboshield/package.json, which shifted peer-dependency resolution
hashes across the whole pnpm-lock.yaml. That shift stopped hoisting two
packages other apps were silently relying on, breaking their shared
root Dockerfile builds on the very next push to main:

- climatemappedafrica: `next build` failed with "Cannot find module
  'express' or its corresponding type declarations" in server.ts.
  @types/express was already in the workspace catalog but never
  declared as a devDependency here.
- codeforafrica/charterafrica: `payload build` failed with "Cannot
  find module 'ajv'". @payloadcms/bundler-webpack peer-requires
  ajv@8.14.0, which nothing else in either app's dependency tree pulls
  in directly. Added ajv to the shared catalog since multiple apps
  need the same pinned version.

Verified locally: `pnpm --filter climatemappedafrica build:next` and
`pnpm --filter {codeforafrica,charterafrica} build-payload` all pass.
Comment thread apps/climatemappedafrica/package.json
Comment thread pnpm-workspace.yaml Outdated
kilemensi noted the exact "8.14.0" pin was inconsistent with every
other catalog entry. Latest ajv (8.20.0) is close enough behind that a
caret range is safe, so use ^8.14.0 like the rest of the catalog.

@kilemensi kilemensi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀


Converting both to plain .js is a better fix, but it's real code change (not a rename), so I'd rather do it as a follow-up than fold it into this PR.

Stripping out types (I assume that's what you mean) is not a real code change. But cool, as long as we fix it ASAP, all will be well.

@kilemensi kilemensi added the chore A task that needs to be done (neither enhancement or bug) label Aug 20, 2026
@github-project-automation github-project-automation Bot moved this to 🚧 In Progress in COMMONS Aug 20, 2026
@kelvinkipruto
kelvinkipruto added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit f98606f Aug 20, 2026
14 checks passed
@kelvinkipruto
kelvinkipruto deleted the fix/legacy-payload-build-deps branch August 20, 2026 12:18
@github-project-automation github-project-automation Bot moved this from 🚧 In Progress to ✅ Done in COMMONS Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A task that needs to be done (neither enhancement or bug)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants