Environment
- Amplify Hosting, platform WEB_COMPUTE (Next.js - SSR), monorepo (
AMPLIFY_MONOREPO_APP_ROOT=apps/web)
- Region:
us-east-1
- App ID:
d13ckekjifghi7 (account details available on request)
Summary
Every build runs a stale 2-command preBuild:
# Executing command: npm install -g pnpm@10.33.0
# Executing command: pnpm install --frozen-lockfile
regardless of the current build specification. The correct, updated spec (which adds a preBuild step that authenticates to a private npm registry before pnpm install) exists in all of the following, and the build ignores every one:
- Repository root
amplify.yml (which the console banner states overrides the console build settings).
aws amplify update-app --build-spec <correct spec> — persisted; confirmed via get-app.
aws amplify update-branch --build-spec <correct spec>.
- Console → Build settings → Edit → Save (the console reflects the new spec).
- Console → App settings → Reconnect repository.
- Deleting and recreating the branch — a brand-new branch (job counter reset to
1) still ran the old 2 commands.
get-app returns the correct (updated) build spec, yet the build never runs it — the build's effective build specification appears decoupled from the app/branch/console buildSpec at the app level.
Impact
Because the updated preBuild step never runs, pnpm install can't authenticate to the private registry (HTTP 401) and the build fails. Production main builds have failed continuously since the private dependency was added.
Reproduction
- Update the build spec via any/all of the methods above.
- Trigger a new build.
- The build log shows only the old 2 commands, never the updated
preBuild steps.
Verified across multiple commits, a fresh build after a console Save, and a brand-new branch created via delete + recreate.
Expected
Builds use the current build specification — either the repo amplify.yml (per the documented override) or the saved console build settings.
Ask
How do we force Amplify to re-read/refresh the effective build specification for an app + branch? Is there a known caching layer that survives UpdateApp, console Save, Reconnect repository, and branch delete/recreate? Short of recreating the entire app, what clears it?
Environment
AMPLIFY_MONOREPO_APP_ROOT=apps/web)us-east-1d13ckekjifghi7(account details available on request)Summary
Every build runs a stale 2-command
preBuild:regardless of the current build specification. The correct, updated spec (which adds a
preBuildstep that authenticates to a private npm registry beforepnpm install) exists in all of the following, and the build ignores every one:amplify.yml(which the console banner states overrides the console build settings).aws amplify update-app --build-spec <correct spec>— persisted; confirmed viaget-app.aws amplify update-branch --build-spec <correct spec>.1) still ran the old 2 commands.get-appreturns the correct (updated) build spec, yet the build never runs it — the build's effective build specification appears decoupled from the app/branch/console buildSpec at the app level.Impact
Because the updated
preBuildstep never runs,pnpm installcan't authenticate to the private registry (HTTP401) and the build fails. Productionmainbuilds have failed continuously since the private dependency was added.Reproduction
preBuildsteps.Verified across multiple commits, a fresh build after a console Save, and a brand-new branch created via delete + recreate.
Expected
Builds use the current build specification — either the repo
amplify.yml(per the documented override) or the saved console build settings.Ask
How do we force Amplify to re-read/refresh the effective build specification for an app + branch? Is there a known caching layer that survives
UpdateApp, console Save, Reconnect repository, and branch delete/recreate? Short of recreating the entire app, what clears it?