Skip to content

fix(angular): find build manifest in noisy output - #697

Merged
leoortizz merged 5 commits into
mainfrom
fix/angular-manifest-extraction
Dec 2, 2026
Merged

leoortizz merged 5 commits into
mainfrom
fix/angular-manifest-extraction

Conversation

@leoortizz

Copy link
Copy Markdown
Member

Makes the Angular adapter find the build manifest even when the build prints other output.

The adapter read the manifest from the first { to the last } of the build output. Any other brace broke the build with Failed to parse build output manifest. Those braces come from:

  • the build script npm echoes, such as ng build --configuration ${APP_ENV:-development}
  • objects the app logs while prerendering

Turbo builds also failed unless the app package was named web, because the adapter only removed Turbo's log prefix for that name.

Changes

  • Find the manifest and ignores the rest of the output
  • Remove Turbo's log prefix regardless of package name

Fixes #423

Scenarios tested

Tested locally and in App Hosting deployments

Scenario Before After
Build script using ${APP_ENV:-development} Manifest parse error Builds
Objects logged during prerender Manifest parse error Builds
Turbo monorepo, app package not named web Manifest parse error Builds
Turbo monorepo, app package named web Builds Builds
SPA, SSG, SSR and SSR+SSG starters Builds Builds
Manifest missing a required field Error names the field Error names the field

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request improves the extraction of the Angular build manifest from console output by introducing a more robust parsing mechanism that scans for JSON candidates from the end of the output, cleans Turbo-prefixed lines, and validates them against the schema. It also adds comprehensive unit tests for these scenarios. The review feedback suggests trimming trailing whitespace when checking for opening and closing braces to prevent parsing failures due to terminal formatting or logging libraries.

@abhis3 abhis3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Clean fix for #423 / #496 and for Turbo monorepos with non-web or ANSI-colored prefixes, and the new unit tests for parseOutputBundleOptions are a great addition. Left one small non-blocking suggestion on lines[start].indexOf("{") for the partial-line multi-line case.

@leoortizz
leoortizz merged commit bb60df8 into main Dec 2, 2026
22 checks passed
@leoortizz
leoortizz deleted the fix/angular-manifest-extraction branch December 2, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Hosting Angular Adapter fails when Pre-rendering is enabled and there are logs

2 participants