-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Upgrade to Aangular V4 fails #14513
Comments
err msg? |
Updated issue description. Error is
|
Typescript version ? |
2.1.6 |
@vicb is there something trivial I am missing here. I have tried to look up breaking charges, but the changelog does not mention this. I am using typescript 2.1 for both 2.4.7 and 4.0 beta, so it may not be typescript issue. |
This is still an issue with rc.1. Is there a workaround or fix? |
I'm getting the same error for a component of mine:
It looks like ngc doesn't like built-in types, |
@Tragetaschen did you provide |
What do you mean? The way I use this service is through export function defaultAlarmService() {
return new AlarmService(false, false);
}
// ...
{ provide: AlarmService, useFactory: defaultAlarmService }, |
@Tragetaschen ensure that you don't have somewhere |
Done. I have |
paste InstrumentAlarmService |
import { Injectable } from '@angular/core';
import { GuiConnectionService } from './gui-connection.service';
import { AlarmService } from './alarm.service';
@Injectable()
export class InstrumentAlarmService extends AlarmService {
constructor(guiConnectionService: GuiConnectionService) {
super(false, false);
// simplified:
guiConnectionService.Update
.subscribe(x => {
this.P1.next(x.P1);
this.P2.next(x.P2);
});
}
} |
@DzmitryShylovich Any chance you can help me with this repo https://github.com/mmrath/ng4-upgrade-test This fails with beta 7 as well as rc1 |
@Tragetaschen the same code does work in 2.x with aot, right? |
Yes, 2.4.8 is what I upgraded to last Friday before going to 4.0.0-rc.1 today |
I've reproduced the issue based on an angular-cli project: https://github.com/Tragetaschen/angular-issue-n14513 The second commit adds two services as above. The third commit upgrades to angular 4.0.0-rc.1 and fails with the above error: |
@Tragetaschen interesting. and error disappears when you remove |
|
The original example repo that I provided contains code from covalent. I see there is a merged PR which resolves the issue. I'll give it a try today |
@mmrath did it help? |
This appears to be a compiler/metadata issue, not http. Reassigning. |
This is resoved. |
I just had to remove Injectable annotation |
Worth noting to anybody who sees this, if you have a normal class you use for just constructing objects, leave out the @Injectable annotation, it seems that from Angular 5 onwards it will cause an error in aot compiling. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
AOT compilation success with 2.4.7 but fails with 4.0.0-beta.7
Error on console:
Expected behavior
AOT compilation should pass with 4.0.0-beta.7
Minimal reproduction of the problem with instructions
A very minimal repo is located at https://github.com/mmrath/ng4-upgrade-test
master
branch has code for 4.0.0-beta.7 which is failing to build.ng2
branch has code for 2.4.7 which builds successfully. The only change here is version numbers for angular packagesTo build run
npm install
and thenng build --prod
assuming cli is installed globallyWhat is the motivation / use case for changing the behavior?
Please tell us about your environment:
@angular/cli: beta 31
node 7.2.1
npm 3.10.10
node --version
=v7.2.1
The text was updated successfully, but these errors were encountered: