Skip to content

Since IVY WARNING "environment.prod.ts is part of the TypeScript compilation but it's unused." #17485

@ofirrifo

Description

@ofirrifo

🐞 Bug report

I updated my project from angular 8 to 9.1 and now I get this WARNING:

WARNING in /Users/.../src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

my main tsconfig.json file

{
  "compileOnSave": false,
  "compilerOptions": {
    "incremental": true,
    "module": "esnext",
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ]
  },
  "plugins": [
    {
      "name": "@angular/language-service"
    }
  ],
  "angularCompilerOptions": {
    "preserveWhitespaces": false
  },
  "exclude": [
    "node_modules"
  ]
}

Command (mark with an x)

  • [x ] build
  • serve

Is this a regression?

Yes it is regression.
the warning never show before the update to Angular 9.1

🔬 Minimal Reproduction

execute npm start or npm build

-->

🔥 Exception or Error


WARNING in /Users/.../src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

🌍 Your Environment


Angular CLI: 9.1.1
Node: 12.3.1
OS: darwin x64

Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.1
@angular-devkit/build-angular     0.901.1
@angular-devkit/build-optimizer   0.901.1
@angular-devkit/build-webpack     0.901.1
@angular-devkit/core              9.1.1
@angular-devkit/schematics        9.1.1
@angular-devkit/schematics-cli    0.803.26
@angular/cdk                      9.2.1
@angular/cli                      9.1.1
@angular/material                 9.2.1
@ngtools/webpack                  9.1.1
@nguniversal/common               9.1.0
@nguniversal/express-engine       9.1.0
@schematics/angular               9.1.1
@schematics/schematics            0.803.26
@schematics/update                0.901.1
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

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