Skip to content

ng add crashes with ReferenceError: e is not defined instead of warning when dataconnect.yaml cannot be parsed #3710

Description

@armando-navarro

Version info

Angular: 21.2.x Firebase: 12.x AngularFire: 21.0.0-rc.0

How to reproduce these conditions

  1. A workspace whose firebase.json has a dataconnect.source entry, where the referenced dataconnect.yaml (or its connector's connector.yaml) is missing, unreadable, or malformed.
  2. Run ng add @angular/fire so the setup schematic calls parseDataConnectConfig.

Expected behavior

The parse failure is caught and logged ("Couldn't parse dataconnect.yaml" plus the underlying error), and setup continues with the Data Connect config treated as absent — which is what the catch handler is written to do.

Actual behavior

The catch handler names its error variable _ but logs e, which is not defined (src/schematics/utils.ts:379):

} catch (_) {
  console.error("Couldn't parse dataconnect.yaml", e);
  return null;
}

Evaluating e throws ReferenceError: e is not defined from inside the catch, so the schematic crashes with an error that points nowhere near the actual problem (the YAML). Nothing typechecks this file today — the library build excludes the schematics and esbuild doesn't check types — which is how the undefined identifier survived. Introduced in #3638.

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