Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Wrong environment path in server configuration after ng add @nguniversal without default application. #1177

@celom

Description

@celom

Bug Report

What is the expected behavior?

After adding @nguniversal using ng add, without a default workspace application, the environment path from angular.json in projects.[clientProject].architect.server.configurations.production.fileReplacement should inherit the same values from projects.[clientProject].architect.build.configurations.production.fileReplacement.

What is the current behavior?

Environment path is populated with the default "src/environments/environment.ts" value, regardless of the specified clientProject environment path.

environment_bug

What modules are related to this issue?

- [ ] aspnetcore-engine
- [ ] common
- [x] express-engine
- [ ] hapi-engine
- [ ] module-map-ngfactory-loader

Minimal reproduction with instructions:

  1. Create empty workspace : ng new appEnvironment --create-application false --routing false --style css
  2. Create application : ng g application bug --routing --style css
  3. Add @nguniversal to"bug" application : ng add @nguniversal/express-engine --clientProject bug
  4. Run build:ssr : npm run build:ssr
    [fail]

What is the use-case or motivation for changing an existing behavior?

Fix bug. Unfrustrate. Promote world peace.

Environment:

Angular CLI: 8.0.3
Node: 12.3.1
OS: win32 x64
Angular: 8.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package Version

@angular-devkit/architect 0.800.3
@angular-devkit/build-angular 0.800.3
@angular-devkit/build-optimizer 0.800.3
@angular-devkit/build-webpack 0.800.3
@angular-devkit/core 8.0.3
@angular-devkit/schematics 8.0.3
@angular/cli 8.0.3
@ngtools/webpack 8.0.3
@nguniversal/express-engine 7.0.2
@nguniversal/module-map-ngfactory-loader 7.0.2
@schematics/angular 8.0.3
@schematics/update 0.800.3
rxjs 6.4.0
typescript 3.4.5
webpack 4.30.0

Is there anything else we should know?

You rock!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions