Angular-cli: Add option to keep $$_gendir around for debugging purposes.

Created on 5 May 2017  路  11Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request

Versions.

$ ng --version
@angular/cli: 1.0.1
node: 7.9.0
os: darwin x64
@angular/animations: 4.1.0
@angular/common: 4.1.0
@angular/compiler: 4.1.0
@angular/core: 4.1.0
@angular/forms: 4.1.0
@angular/http: 4.1.0
@angular/material: 2.0.0-beta.3
@angular/platform-browser: 4.1.0
@angular/platform-browser-dynamic: 4.1.0
@angular/router: 4.1.0
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.0

OSX 10.12.4

Repro steps.

Any ng command line failure

The log given by the failure.

For instance:

ERROR in src/$$_gendir/app/core/core.module.ngfactory.ts (308,7): Supplied parameters do not match any signature of call target.

ERROR in src/$$_gendir/app/app.module.ngfactory.ts (355,7): Supplied parameters do not match any signature of call target.

Desired functionality.

I am not able to access $$_gendir to begin an investigation as to what may be the issue. In this particular case, I discovered that I needed to declare a parameter, even though I wasn't using it, for AOT.

It would be great it ng had a flag to keep the intermediate build dir around for inspection.
Maybe --keep-gendir

Mention any other details that might be useful.

easy (hours) 3 (nice to have) feature

Most helpful comment

Thanks. The full issue is far more illuminating. I was actually going to ask for the scenario you were encountering.
Ideally the error should be mapped back to the relevant origin source file. But maybe some type of '--gen-dump' option with a path could be useful on the ng build command as a stopgap.

All 11 comments

It's actually completely in memory so there really is nothing to keep around.
You didn't fill out what versions you are using but with the latest angular and CLI, template error message should be improved over earlier versions with more improvements on the way.

Couldn't it write out like a core dump in case of an error?

Sorry.. just noticed most of my bug report was commented out with html :)
You should now be able to see it all above

@hansl WDYT?

Thanks. The full issue is far more illuminating. I was actually going to ask for the scenario you were encountering.
Ideally the error should be mapped back to the relevant origin source file. But maybe some type of '--gen-dump' option with a path could be useful on the ng build command as a stopgap.

The ability to output these files would also be helpful even in the absence of errors - I would show them while explaining the purpose and benefit of AOT to new-to-Angular developers. (Without needing to switch away from CLI to ngc.)

Is there any progress? This is very useful option to debugging

I just ran into an issue that looks like https://github.com/angular/angular-cli/issues/7062, which would be much easier to figure out if it was possible to search the $$_gendir for the issue.

Hoping for this too :(

There is no gendir anymore. We should have proper debugging tools for builds, but this issue is not one of them.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajjejosefsson picture rajjejosefsson  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

purushottamjha picture purushottamjha  路  3Comments