Skip to content

Builder never yields BuilderOutput during serve, breaking ng e2e / Architect consumers #1076

@husgutt

Description

@husgutt

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

Hi,

I let Claude explain my issue, and possible fix, to make my issue clearer. I don't fully understand the possible bug, so I hope this is ok.

Running ng e2e with Cypress hangs after the dev server starts — Cypress never receives the ready signal to begin tests.
The root cause appears to be in builder.ts. The for await loop over builderRun never yields BuilderOutput back to the Architect pipeline. The only yield is after the loop exits, which for serveWithVite means never (it's an infinite async iterator).

There is also commented-out code that suggests this was previously considered:
https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/src/builders/build/builder.ts#L402

This means any Architect consumer waiting for BuilderOutput (like @cypress/schematic via devServerTarget) will hang indefinitely.

Expected behavior

ng e2e should start the dev server and yield BuilderOutput with success: true so that downstream builders (Cypress, Playwright, etc.) receive the ready signal and can start running tests.

Versions of Native/Module Federation, Angular, Node, Browser, and operating system

Native Federation: 20.3.1
Angular: 20.3.16
node: 22.22.0
Chrome, Windows 11

Other information

Add yield output; inside the for await loop so each output from the underlying Angular builder is forwarded to Architect consumers.

Adding yield output; worked for me

                });
            }
            first = false;
            yield output;
        }
    }
    finally {

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions