I have defined the following imports in an Angular 7 project, which was being done in other components in products.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgSelectModule } from '@ng-select/ng-select';
//*****Implementacion NgX boostrap
import { DatePickerModule } from '../Helpers/DatePicker/DatePicker.module';
import { BsDatepickerModule } from 'ngx-bootstrap';
//*************************************
//Implementacion Datepicker ng-boostrap
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgbdDatepickerPopup } from '../Helpers/DatePicker/DatePickerNgB/DatepickerPopup.component';
As the error message I get that something is not registered in the tsconfig.json I expose it since I do not understand if the project was working without registering anything in the json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"types": [ "node" ]
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
Is there something I omitted when creating the module?
I'm somewhat new to angular and I think I've been missing something. the specific error when I do ng build is:
\src\app\products\products.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
UPDATE The angular.json file is exposed...
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"defaultProject": "co.ProInvestigacion.Web",
"newProjectRoot": "projects",
"projects": {
"co.ProInvestigacion.Web": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"progress": true,
"extractCss": true,
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/assets"
],
"styles": [
"node_modules/datatables.net-dt/css/jquery.dataTables.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/bootstrap/less/bootstrap.less",
"src/styles.css",
"node_modules/jquery-ui-dist/jquery-ui.css",
"node_modules/@fortawesome/fontawesome-free/css/fontawesome.css",
"node_modules/@fortawesome/fontawesome-free/css/all.css",
"node_modules/@fortawesome/fontawesome-free/css/brands.css",
"node_modules/@fortawesome/fontawesome-free/css/regular.css",
"node_modules/@fortawesome/fontawesome-free/css/solid.css",
"node_modules/@ng-select/ng-select/themes/default.theme.css",
"node_modules/ngx-bootstrap/datepicker/bs-datepicker.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.js",
"node_modules/jquery-ui-dist/jquery-ui.js",
"node_modules/datatables.net/js/jquery.dataTables.js",
"node_modules/bootstrap/js/dropdown.js",
"node_modules/bootstrap/js/modal.js",
"src/styles.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "co.ProInvestigacion.Web:build"
},
"configurations": {
"production": {
"browserTarget": "co.ProInvestigacion.Web:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "co.ProInvestigacion.Web:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"styles.css"
],
"scripts": [],
"assets": [
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist-server",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"dev": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": true
},
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
}
}
},
"co.ProInvestigacion.Web-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "co.ProInvestigacion.Web:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"exclude": [
"**/node_modules/**"
],
"tsConfig": "e2e/tsconfig.e2e.json"
}
}
}
}
},
"version": 1
}
the path of that file is this: src\app\Products\products.module.ts
The solution was to remove the product component(s) and recreate it.
apparently as @PabloLozano told me if there was a problem with "... the name Products and products does not look the same. Try renaming the directory"
In my case, I renamed it but a Warning came out again. The solution was to create the component again without placing uppercase and lowercase letters.
Also the contribution of @Legna was useful since the versioning (Microsoft TFS) places problems and keeps elements in cache.