Closed HuserOz closed 10 months ago
Could you please provide the output of this command in your CLI workspace?
npm list webpack @angular/core @ngx-env/builder
I think it depends on the settings or typescript version
/// <reference path="../env.d.ts" />
for env files should fix this error
Same issue here! At. Node 16.20 and Angular 15.2
Also happens with @ngx-env/builder@16
├─┬ @angular-devkit/build-angular@15.2.9
│ ├─┬ @angular-devkit/build-webpack@0.1502.9
│ │ ├─┬ webpack-dev-server@4.15.1
│ │ │ ├─┬ webpack-dev-middleware@5.3.3
│ │ │ │ └── webpack@5.86.0 deduped
│ │ │ └── webpack@5.86.0 deduped
│ │ └── webpack@5.86.0 deduped
│ ├─┬ @angular/service-worker@15.2.9
│ │ └── @angular/core@15.2.9 deduped
│ ├─┬ @ngtools/webpack@15.2.9
│ │ └── webpack@5.86.0 deduped
│ ├─┬ babel-loader@9.1.2
│ │ └── webpack@5.86.0 deduped
│ ├─┬ copy-webpack-plugin@11.0.0
│ │ └── webpack@5.76.1 deduped
│ ├─┬ css-loader@6.7.3
│ │ └── webpack@5.76.1 deduped
│ ├─┬ less-loader@11.1.0
│ │ └── webpack@5.86.0 deduped
│ ├─┬ mini-css-extract-plugin@2.7.2
│ │ └── webpack@5.76.1 deduped
│ ├─┬ postcss-loader@7.0.2
│ │ └── webpack@5.76.1 deduped
│ ├─┬ sass-loader@13.2.0
│ │ └── webpack@5.76.1 deduped
│ ├─┬ source-map-loader@4.0.1
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-dev-middleware@6.0.1
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-dev-server@4.11.1
│ │ ├─┬ webpack-dev-middleware@5.3.3
│ │ │ └── webpack@5.76.1 deduped
│ │ └── webpack@5.76.1 deduped
│ ├─┬ webpack-subresource-integrity@5.1.0
│ │ └── webpack@5.86.0 deduped
│ └─┬ webpack@5.76.1
│ └─┬ terser-webpack-plugin@5.3.9
│ └── webpack@5.86.0 deduped
├─┬ @angular/animations@15.2.9
│ └── @angular/core@15.2.9 deduped
├─┬ @angular/common@15.2.9
│ └── @angular/core@15.2.9 deduped
├─┬ @angular/compiler@15.2.9
│ └── @angular/core@15.2.9 deduped
├── @angular/core@15.2.9
├─┬ @angular/forms@15.2.9
│ └── @angular/core@15.2.9 deduped
├─┬ @angular/platform-browser-dynamic@15.2.9
│ └── @angular/core@15.2.9 deduped
├─┬ @angular/platform-browser@15.2.9
│ └── @angular/core@15.2.9 deduped
├─┬ @angular/router@15.2.9
│ └── @angular/core@15.2.9 deduped
├── @ngx-env/builder@15.2.1
├─┬ @nrwl/angular@15.9.4
│ ├─┬ @nrwl/webpack@15.9.4
│ │ ├─┬ copy-webpack-plugin@10.2.4
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ css-loader@6.8.1
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ css-minimizer-webpack-plugin@3.4.1
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ file-loader@6.2.0
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ fork-ts-checker-webpack-plugin@7.2.13
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ mini-css-extract-plugin@2.4.7
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ postcss-loader@6.2.1
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ sass-loader@12.6.0
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ source-map-loader@3.0.2
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ style-loader@3.3.3
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ stylus-loader@7.1.3
│ │ │ └── webpack@5.86.0 deduped
│ │ ├─┬ ts-loader@9.4.3
│ │ │ └── webpack@5.86.0 deduped
│ │ └── webpack@5.86.0 deduped
│ └── webpack@5.86.0
├─┬ @po-ui/ng-components@15.9.2
│ ├─┬ @angular/cdk@15.2.9
│ │ └── @angular/core@15.2.9 deduped
│ └── @angular/core@15.2.9 deduped
├─┬ @po-ui/ng-templates@15.9.2
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-buttons@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ ├─┬ @progress/kendo-angular-icons@13.2.0
│ │ └── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-schematics@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-common@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-dateinputs@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-navigation@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-dropdowns@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-excel-export@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-grid@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-utils@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-inputs@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ ├─┬ @progress/kendo-angular-dialog@13.2.0
│ │ └── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-upload@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-intl@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-l10n@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-label@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-layout@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-pdf-export@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-popup@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-progressbar@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @progress/kendo-angular-treeview@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @testing-library/angular@14.1.1
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/sl-base-foundation@15.0.0
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/sl-kendo-grid@15.0.3
│ ├── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-treelist@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-listview@13.2.0
│ ├── @angular/core@15.2.9 deduped
│ └─┬ @progress/kendo-angular-pager@13.2.0
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/sl-web-foundation@15.0.1
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/supply-access@15.0.1
│ ├── @angular/core@15.2.9 deduped
│ └─┬ angular-oauth2-oidc@15.0.1
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/supply-host-config@15.0.1
│ └── @angular/core@15.2.9 deduped
├─┬ @totvs-supply/supply-oauth2@15.0.1
│ └── @angular/core@15.2.9 deduped
└─┬ jest-preset-angular@13.0.1
└── @angular/core@15.2.9 deduped
hey, any chance to have repo or a stackblitz reproducing the issue?
@HuserOz if you have "files" or "include" options in your tsconfig, you may need to include your declaration file there, or it may be not picked up correctly
Besides specifying paths in tsconfigs, you also need to update your nodejs and it's types definition (@types/node) to the newer ones. In my case, they were updated from 18.16.0 to 20.11.0.
interface ImportMetaEnv { /**
------- @ngx-env/builder -------
Injected keys: ✔ NG_APP_ENV => undefined ✔ NG_APP_VERSION
But when i try to read the NG_APP_VERSION in my environment.ts file like this:
i'm getting this error:
I can see that builders are changed to ngx-env builders in my angular.json file:
What might be causing this error?