Index.ts is not part of compilation output

I am trying to compile my Angular application and I am getting an error. The compiler does not seem to recognize the index.ts file. I'm not sure why.

The following is the error:

ERROR in ./node_modules/datatable/index.ts
Module build failed: Error: node_modules\datatable\index.ts is not part of the compilation output. Please check the other error messages for details.
    at AngularCompilerPlugin.getCompiledFile (node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:629:23)
    at plugin.done.then (node_modules\@ngtools\webpack\src\loader.js:467:39)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/main/ui/app/app.module.ts 13:0-59
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
ERROR in ./node_modules/typeahead/index.ts
Module build failed: Error: node_modules\typeahead\index.ts is not part of the compilation output. Please check the other error messages for details.
    at AngularCompilerPlugin.getCompiledFile (\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:629:23)
    at plugin.done.then (node_modules\@ngtools\webpack\src\loader.js:467:39)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/main/ui/app/app.module.ts 12:0-59
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

Does anyone have any suggestions for fixing this? Thank.

+4
source share
4 answers

It was a simple fix. Follow these steps: npm install --save @ ngtools / webpack @ 1.2.4

+1
source

I had a similar problem with angular-bootstrap-md \ index.ts

how can i fix this:

Just put the index.ts file in tsconfig.jsons enable block , see below:

{
  "compileOnSave": false,
  "compilerOptions": {
  "outDir": "./dist/out-tsc",
  "sourceMap": true,
  "declaration": false,
  "moduleResolution": "node",
  "emitDecoratorMetadata": true,
  "experimentalDecorators": true,
  "target": "es5",
  "typeRoots": [
    "node_modules/@types"
  ],
  "lib": [
    "es2017",
    "dom"
  ]  
},
"include": [
  "src/**/*",
  "node_modules/angular-bootstrap-md/index.ts"
  ]
 }

: https://github.com/angular/angular/issues/20091

+3

, . typescript , javascript.

, , , ts (*.d.ts).

(typeahead datatable) , .npmignore. .ts, .d.ts, . , , /.

+1

I had a similar problem when the application directory was somewhere in the% users% \ Documents directory. After I copied the entire directory to another path (for example, C: \ Data \ Angular), the error disappeared.

0
source

Source: https://habr.com/ru/post/1688954/


All Articles