-
Notifications
You must be signed in to change notification settings - Fork 12k
Error when building with -prod: Module not found: Error: Can't resolve '@angular/http/src/http' #8858
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
Comments
You are using Angular 5.x and HttpModule was deprecated. It is replaced by HttpClient (https://angular.io/api/common/http/HttpClient). I hope it resolves your problem :) |
It looks like I was including If I remove the HttpModule it starts complaining that there is no module providing |
I have something similar:
I am using the HttpClientModule. I found a similar discussion on the Ionic repo and they specify that it is a wrong error and we can just use ngc instead but I have no error using it... |
@tanis2000 Yes, if you've upgraded to Angular 5 then @angular/http is deprecated. You can switch out your This will give you some compile errors as the API for |
This issue is a support issue and also seems resolved. Closing. |
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. |
Versions
Repro steps
ng build -prod
on the projectObserved behavior
Desired behavior
It should build the application with AOT for the production environment.
Mention any other details that might be useful (optional)
Here's my main.ts file:
And the app.module.ts file:
Any help is really appreciated! :)
The text was updated successfully, but these errors were encountered: