Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular >= 5.1.0-rc.0 regression in AOT compilation error reporting #20781

Closed
Sky4CE opened this issue Dec 4, 2017 · 9 comments
Closed

Angular >= 5.1.0-rc.0 regression in AOT compilation error reporting #20781

Sky4CE opened this issue Dec 4, 2017 · 9 comments

Comments

@Sky4CE
Copy link

@Sky4CE Sky4CE commented Dec 4, 2017

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When building with AOT I get very general error which is useless a bit more than completely.
image

P.S.: Version 5.1.0-beta.2 shows proper error message in this particular case.

Expected behavior

Error should describe root of the problem with proper stacktrace.

Minimal reproduction of the problem with instructions

reproduction repository (make sure you're on 5.1.0-rc.0-regression branch)
to run: ng build --aot=true or ng build --prod

Environment


Angular version: 5.1.0-rc.0 and 5.1.0-rc.1

 
For Tooling issues:
- Node version: 6.11.1
- Npm: 5.5.1
- Platform:  Windows10 x64

@chuckjaz
Copy link
Contributor

@chuckjaz chuckjaz commented Dec 5, 2017

@Sky4CE Can you produce a repository that reproduces the error? What was the text of the error you received in 5.1.0-beta-2 and how is it different than 5.1.0-rc.1?

Also, it would be more helpful if you included the entire text of the error instead of just a screen shot of part of it.

@Sky4CE
Copy link
Author

@Sky4CE Sky4CE commented Dec 5, 2017

@chuckjaz , the point is that in 5.1.0-rc.0 and 5.1.0-rc.1 the text always the same regardless of error I have, it can be any error, it always states that it cannot find main app module factory while in beta-2 it was precise error about the problem, i.e. some parameters could not be resolved in constructor or some properties is private but used on template etc, and it points to exact file with problem:
image
Actually I have included the full text with error (for 5.1.0-rc.0 and 5.1.0-rc.1), the rest is just regular webpack metadata info about built html etc... the same as in beta-2. I have also tried 'verbose' logging and there was no additional useful info. I will prepare a repo later, right now I have no time, sorry.

@chuckjaz
Copy link
Contributor

@chuckjaz chuckjaz commented Dec 5, 2017

I am not seeing the same thing.

Can you create a repository I can clone that produces the error message you are seeing. I will then test this against 5.1.0-beta.1 and 5.1.0-rc.1 and see the difference.

BTW, In the future, please refrain from using images captures of your screen; pasting the text from the console is usually sufficient.

@Sky4CE
Copy link
Author

@Sky4CE Sky4CE commented Dec 6, 2017

@chuckjaz I have prepared reproduction repo for you, it uses angular-cli and barrels system. In fact problem related to this bug , I've found it when testing different kind of errors and current problem with insufficient error message appears with barrels bug. Please make sure you restoring 5.1.0-rc.0-regression branch from my repo. Then just build it with aot either ng build --aot=true or ng build --prod to see error.

@Sky4CE
Copy link
Author

@Sky4CE Sky4CE commented Dec 7, 2017

@chuckjaz , any progress on this? I saw v5.1.0 has been released, I tested it and saw that this bug didn't resolved, that's very disappointed. This situation force me to stay on 5.1.0-beta2

@Andrey-Pavlov
Copy link

@Andrey-Pavlov Andrey-Pavlov commented Dec 8, 2017

@Sky4CE THANK YOU!
Rollback Angular to 5.1.0-beta.2 helped me to find AOT build fails and resolve the mysterious error message:

Error: ./src/app/main.ts
Module not found: Error: Can't resolve './app.module.ngfactory'

@earlyster
Copy link

@earlyster earlyster commented Dec 11, 2017

I also faced similar issue and using @Sky4CE and @Andrey-Pavlov solution to go back to 5.1.0-beta.2 helped show correct error message due to issue with missing @Inject tag for locale. I wanted to give example I ran into.

before:

    constructor(private locale: string) {
      super(locale);
    }

with 5.1 I received the aot strange error message

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './app/app.browser.module.ngfactory' in 'src'
resolve './app/app.browser.module.ngfactory' in 'src'
using description file: /package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration

after

constructor(@Inject(LOCALE_ID) private locale: string) {
  super(locale);
}

ERROR in Error: Can't resolve all parameters for NegativeNumberPipe in pipes/custom-pipe.pipe.ts: (?).

@alxhub alxhub moved this from Pri 0 to In progress in Compiler Dec 13, 2017
@alxhub
Copy link
Contributor

@alxhub alxhub commented Dec 13, 2017

I've converted the reproduction into an ngc_spec test: alxhub@b86bf5f

The good news is that this test passes on master! So this issue is resolved, and I'll close it as such.

@alxhub alxhub closed this Dec 13, 2017
Compiler automation moved this from In progress to Done Dec 13, 2017
@chuckjaz chuckjaz removed this from Done in Compiler Dec 19, 2017
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 13, 2019

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.