@angular/common = ^5.0.0
@angular/cli = "1.6.0
When i run "ng serve" this error appears
Module build failed: Error: /home/maique/projetos/centroDiagnostico/node_modules/ng2-inputmask/src/input-mask.module.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (/home/maique/projetos/centroDiagnostico/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:648:23)
at plugin.done.then (/home/maique/projetos/centroDiagnostico/node_modules/@ngtools/webpack/src/loader.js:467:39)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
@ ./src/app/app.module.ts 15:0-48
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
i search for the solution and found this post: angular/angular-cli#8284
Hey all, this is a side effect of the stricter tsconfig as described in https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced#148d.
The tsconfig file is what determines what TS files are compiled. The error you are getting means that the files mentioned are NOT being compiled.
Before we used to compile all files, essentially ignoring what tsconfig listed. This was a bug, because if you don't include a file in the compilation then it should not be compiled.
By default ./src/tsconfig.app.json will only pick up files inside src/. If you have a file outside source, it won't be picked up. But you can add more files to the tsconfig via either files or include.
So for @thaoula's case, you probably want to add this the files in ../models to your tsconfig.app.json and also to your tsconfig.spec.json:
{
"extends": "../tsconfig.json",
"compilerOptions": {
// ...
},
"include": [
"../models/**/*.ts"
],
"exclude": [
// ...
],
}
You can read more about tsconfig files in https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/tsconfig.json.md.
@rolaveric's case is slightly different. You have TS files in your node_modules. This really goes against how libraries should be packaged: libraries should never ship their source .ts files.
The reason for this rule is that the TypeScript version your app isn't necessarily the same as the TS version your library uses. Different versions of TS can produce different output, and give different errors for the same input. They don't even support the same language features. So packaging libraries with TS sources will always break someone's project.
So we don't really support using incorrectly packaged libraries with TS sources. It's something you do at your risk.
That being said, maybe you can try adding it to the include array. But I can't guarantee that will work in the future because it's still an incorrectly packaged library.
Regarding AOT: as far as I can tell, AOT is still incorrectly compiling TS that is not included in the tsconfig. I'll bring this up with the compiler team.