Fix legacy Payload build failures for climatemappedafrica/codeforafrica/charterafrica - #1509
Merged
Merged
Conversation
…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.
kilemensi
reviewed
Aug 20, 2026
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
approved these changes
Aug 20, 2026
kilemensi
left a comment
Member
There was a problem hiding this comment.
🚀
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix three legacy Docker builds (
climatemappedafrica,codeforafrica,charterafrica) that have been failing on every push tomainfor months.Fixes the
Climate Mapped Africa | Deploy | DEV,Code for Africa | Deploy | DEV, andcharterAFRICA | Deploy | DEVworkflows.Why
These three builds have each been failing on every run since well before this week —
codeforafrica's andclimatemappedafrica's last green run was #1461 on 2026-04-20,charterafrica's since #1409 on 2026-03-05.The failures:
climatemappedafrica:next buildfails withCannot find module 'express' or its corresponding type declarationsinserver.ts.@types/expressis already pinned in the workspace catalog but was never declared as a devDependency in this app.codeforafrica/charterafrica:payload buildfails withCannot find module 'ajv'.@payloadcms/bundler-webpackpeer-requiresajv@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-reactissue (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
@types/express(catalog) toclimatemappedafrica's devDependencies.ajv@8.14.0to the sharedpnpm-workspace.yamlcatalog (used identically by both affected apps) and reference it fromcodeforafrica's andcharterafrica's devDependencies.pnpm-lock.yamlaccordingly.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 theexpresstype error).pnpm --filter codeforafrica build-payload— exits 0 (previously failed with theajverror).pnpm --filter charterafrica build-payload— exits 0 (sameajverror).Type of change
Screenshots
N/A
Checklist