Skip to content

SSR (WEB_COMPUTE) build serves a stale/frozen build specification — ignores repo amplify.yml, console Build settings, UpdateApp/UpdateBranch, Reconnect, and branch recreate #4098

Description

@jpshelley

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:

  1. Repository root amplify.yml (which the console banner states overrides the console build settings).
  2. aws amplify update-app --build-spec <correct spec> — persisted; confirmed via get-app.
  3. aws amplify update-branch --build-spec <correct spec>.
  4. Console → Build settings → Edit → Save (the console reflects the new spec).
  5. Console → App settings → Reconnect repository.
  6. 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

  1. Update the build spec via any/all of the methods above.
  2. Trigger a new build.
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions