Angular-cli: WARNING environments/environment.prod.ts is part of the TypeScript compilation but it's unused

Created on 31 Aug 2019  路  4Comments  路  Source: angular/angular-cli

馃悶 Bug report

Command (mark with an x)


- [x] new
- [x] build

Is this a regression?

Yes, this error wasn't previously thrown.

Description

When building, new warnings are shown about unused files included in compilation.

馃敩 Minimal Reproduction

ng new my-app
cd my-app
ng update @angular/core@next @angular/cli@next
ng build --prod

馃敟 Exception or Error


WARNING in /.../src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.

馃實 Your Environment


Angular CLI: 9.0.0-next.2
Node: 10.15.3
OS: linux x64
Angular: 9.0.0-next.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-next.2
@angular-devkit/build-angular     0.900.0-next.2
@angular-devkit/build-optimizer   0.900.0-next.2
@angular-devkit/build-webpack     0.900.0-next.2
@angular-devkit/core              9.0.0-next.2
@angular-devkit/schematics        9.0.0-next.2
@angular/cli                      9.0.0-next.2
@ngtools/webpack                  9.0.0-next.2
@schematics/angular               9.0.0-next.2
@schematics/update                0.900.0-next.2
rxjs                              6.5.2
typescript                        3.5.3
webpack                           4.39.3

schematicangular

Most helpful comment

If you generated the app prior to version 9. That is expected as to fix that we need to run a migration which is still in PR phase.

See: https://github.com/angular/angular-cli/pull/15469

All 4 comments

@StephenFluin what is the global version of the CLI that was used to do ng new?

Same Error after updating.

src/app/app.server.module.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig.

`Angular CLI: 8.3.2
Node: 10.16.0
OS: win32 x64
Angular: 9.0.0-next.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package Version

@angular-devkit/architect 0.803.2
@angular-devkit/build-angular 0.803.2
@angular-devkit/build-optimizer 0.803.2
@angular-devkit/build-webpack 0.803.2
@angular-devkit/core 7.3.9
@angular-devkit/schematics 7.3.9
@angular/cli 8.3.2
@angular/http 7.2.15
@ngtools/webpack 8.3.2
@nguniversal/common 7.1.1
@nguniversal/express-engine 7.1.1
@nguniversal/module-map-ngfactory-loader 7.1.1
@schematics/angular 7.3.9
@schematics/update 0.803.2
rxjs 6.5.2
typescript 3.6.2
webpack 4.39.2`

If you generated the app prior to version 9. That is expected as to fix that we need to run a migration which is still in PR phase.

See: https://github.com/angular/angular-cli/pull/15469

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings