ERROR REFERENCE
CDK could not bundle an asset
Failed to bundle asset means a local build stopped before
CDK could finish synthesis or deployment. The wrapper names the asset,
but the useful compiler, dependency, permission, or Docker error is
usually after the temporary -error path or earlier in the log.
WHAT IT MEANS
The deployment has not reached CloudFormation yet
Failed to bundle asset amplify-app/function/Api/Code/Stage, bundle output is located at /tmp/cdk.out/bundling-temp-error: Error: esbuild exited with status 1
This is a low-confidence handoff, not the root cause. CDK assets can be bundled by a package manager, compiler, custom command, or Docker image; the exact reason is in the underlying command output.
NEXT CHECK
Recover the first real bundler error
-
Re-run synthesis with the same inputs:
Use the same project directory, app command, context, credentials, environment variables, and build tool versions as the failed job.cdk synth --verbose -
Inspect the named asset and the first preceding error.
Check the package-manager install, compiler entry point, file path,
permissions, and any command shown after the
-errorsuffix. - For Docker bundling, reproduce the exact image and command. Confirm the runner can start Docker and that the image can read the asset input and write the output directory.
AUTOMATE THE TRIAGE
Keep the handoff in your normal workflow
SAM Doctor recognizes the bundling wrapper with low confidence and points at the reproducible build check. It does not invent the missing compiler error. Runs locally; no AWS access, no log upload.
python -m pip install sam-doctor
sam-doctor diagnose deployment.log --format markdown
RELATED
Related errors
- AssemblyError: Assembly builder failed — a broader CDK synthesis wrapper without the asset name.
- SAM build requires Docker — use when the log says the Docker daemon itself is unavailable.
- CREATE_FAILED / UPDATE_FAILED — a CloudFormation resource event that contains a deployment cause.