Skip to content

Recommended approach to using an external config file breaks ng add #662

@fergaldoyle

Description

@fergaldoyle

The documented approach to fetching config from a file/endpoint (https://github.com/mauriciovigolo/keycloak-angular?tab=readme-ov-file#load-the-keycloak-configuration-using-an-external-file) will break ng add or 'ng update' for any library that needs to modify the ApplicationConfig (to add providers etc) because ng add can no longer parse/understand the source code in main.ts.

e.g. if I have a project using keycloak-angular, fetching a config file then bootstrapping the application, and I try to run ng add @jsverse/transloco I'll get the follow error:
Cannot statically analyze bootstrapApplication call in src/main.ts

I wonder could better support for external config files be added so that we don't have to modify the default bootstrapping code. In CICD pipelines it's pretty common that the application is built/compiled once, and the only thing that changes in DEV/INT/UAT/PREPROD/PROD is a config.json file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-investigationNeeds more investigation to identify if it is a bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions