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

[Module: HTTP] - AOT compile fails with angular@next #340

Closed
joshwiens opened this issue Feb 15, 2017 · 4 comments
Closed

[Module: HTTP] - AOT compile fails with angular@next #340

joshwiens opened this issue Feb 15, 2017 · 4 comments

Comments

@joshwiens
Copy link
Contributor

This repository's issues are reserved for feature requests and bug reports.

OS: macOS 10.12.3
NodeJS: Both 6.9.5 (all ng versions) && 7.5.0 (covalent on ng 2.4.7 & 4.0.0-beta.7 only)
Browser: 58.0.3012.0 canary (64-bit)

Bug Report

  • Update to @angular/* 4.0.0-beta.7
  • Execute ./node_modules/.bin/ng build --base-href /covalent/ --aot -prod

AOT Compile fails in http-interceptor.service.ts specifically config.interceptors isn't resolving.

What is the expected behavior?

This is more of a heads up than a bug as there is no real expectation of Angular 4.x support at the moment though imo worth logging as the lib could be @next ready with one fix.

What is the motivation / use case for changing the behavior?

Outside of the one AOT issue, Covalent actually works just fine on 4.x. Actually, it's rendering a bit faster on beta.7 than it does on 2.4.7. as well as "feeling" a bit smoother. Unit tests execute without issue, manually verified consistent behaviors for Covalent running on 2.4.7 & 4.0.0-beta.7 within the confines of the demo application.

Which version of Angular and Material, and which browser and OS does this issue affect?

Tested with 4.0.0-beta.2 through 4.0.0-beta.7 as well as the latest nightly with the same result.

Other information

(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix)

AOT Output

ERROR in Can't resolve all parameters for HttpInterceptorService in /Users/d3viant0ne/Projects/oss/teradata/covalent/src/platform/http/interceptors/http-interceptor.service.ts: ([object Object], [object Object], [object Object], ?).

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/d3viant0ne/Projects/oss/teradata/covalent/src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts
@emoralesb05
Copy link
Contributor

Thanks @d3viant0ne. I think its because we need an OpakeToken for that too.. gonna jump on in this over the next few weeks to see if there is a simple way to fix this.

@emoralesb05
Copy link
Contributor

emoralesb05 commented Feb 24, 2017

I think i found the problem on this.

Angular is checking by default every @Injectable class to see if they are statically analyzable and following the DI providers the right way.

Since the HttpInterceptorService works a little different (like the Router class), we need to remove the @Injectable decorator.

e.g. in Router

https://github.com/angular/angular/blob/5f3c8441e49fd5d31654c0452360c7fa18d624ed/modules/%40angular/router/src/router.ts#L206

Working on a PR, hopefully we will have fully support for 4.0.0.

Phew.. had to do some full on @angular code diving to find this out haha

@joshwiens
Copy link
Contributor Author

@emoralesb05 Nice, I was having a hell of a time trying to figure this one out.

@emoralesb05
Copy link
Contributor

Closing since the issue was merged, but we will heavily check how material will handle their transition into 4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants