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

Created on 17 Sep 2019  路  6Comments  路  Source: nrwl/nx

Expected Behavior

remove warning during compile

Current Behavior

[WDS] Warnings while compiling.
../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.

Failure Information (for bugs)

Steps to Reproduce

  1. Update to Nx 8.5.0
  2. serve the poject
  3. Observe the following warning: ../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.

Context

  • discovered issue when attempting to update to 8.5.0

Failure Logs

[WDS] Warnings while compiling.
../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.

Other

I removed enableIvy: true from tsconfig.app.json then the warning disappeared

Most helpful comment

You're welcome :)
Would you please close the issue, since it is not related to NX?

All 6 comments

Hi @mohijalili
Did you enable Ivy? If so, there is an issue here

Hi @mohijalili
Did you enable Ivy? If so, there is an issue here

Hey @mehrad-rafigh
Yes, it's enabled by default. it seems it will be fixed in next update. Thanks bro.

You're welcome :)
Would you please close the issue, since it is not related to NX?

tsconfig.app.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "types": []
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

Is it safe to delete the file in question if it is unused?

Is it safe to delete the file in question if it is unused?

No , the production build will fail

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zpydee picture zpydee  路  3Comments

danieldanielecki picture danieldanielecki  路  3Comments

ZempTime picture ZempTime  路  3Comments

jon301 picture jon301  路  3Comments

elliotmendiola picture elliotmendiola  路  3Comments