4

I'm using angular-cli to build an app. The build runs fine with the --aot=false option.

I get errors with --aot=true, and to investigate these I'd like to look at the files generated by the compilation (ngFactory files in particular). However I can't seem to get the files to be persisted to disk so I can look at them...

Here's my tsconfig.json:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "commonjs",
    "moduleResolution": "node",
    "lib": ["es6", "dom"],
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": true,
    "noImplicitAny": false,
    "outDir": "aot"
  },
  "compileOnSave": false,
  "exclude": ["test.ts"],
  "angularCompilerOptions": {
    "genDir": "aot",
    "debug": true,
    "skipMetadataEmit": true
    }
}

When compiling with --target=production (implies --aot=true), I get the error:

ERROR in /home/application/aot/app/composition.component.ngfactory.ts (79,9): Supplied parameters do not match any signature of call target.

What I want is to open the composition.component.ngfactory.ts file to debug it.

However when the ng build completes the file does not exist (as if it had been 'cleaned'). There's no aot directory either. If I create the aot directory it remains empty.

Any help appreciated!

Edit: Even creating a new project with ng new (angular-cli 1.0.0) I can't seem to get the intermediate files in aot compilation to be written to disk.

ldirer
  • 6,606
  • 3
  • 24
  • 30
  • Do you have a repo to reproduce it? – yurzui Mar 27 '17 at 10:41
  • i had a similar problem. after deleting the /compiled directory (thats where my compiled files went) and re-compiling the project it was fine. so try finding the directory - delete the whole directory or just that one file - and recompile it – mareks Mar 27 '17 at 12:23
  • 1
    Might want to follow up here: https://github.com/angular/angular-cli/issues/5619 – Brandon Silva Mar 27 '17 at 19:48
  • Thanks @BrandonSilva that's exactly what I'm looking for. I missed that issue in my googling around apparently. I felt the docs suggested it was already possible to get these files though. – ldirer Mar 28 '17 at 05:34

0 Answers0