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
Cannot find module '@angular/common/http/src/response after migrating to Angular 8 #30814
Comments
Try |
Hm, seems like it's not part of the public api https://github.com/angular/angular/blob/f8096d499324cf0961f092944bbaedd05364eea1/packages/common/http/public_api.ts, even though |
Yes, even if I import it from |
This seems indeed to be an unintentional omission in 37797e2. In any case, you should never import from |
Hi @gkalpak , |
Hi @gkalpak , |
Is this resolved. I tried import { HttpUploadProgressEvent } from '@angular/common/http/src/response'; I update my angular to version=8 ERROR in node_modules/ngx-restangular/lib/ngx-restangular-http.d.ts(3,27): error TS2307: Cannot find module '@angular/common/http/src/response'. |
Hi @snahmad , |
Angular CLI: 8.1.1 Package Version@angular-devkit/architect 0.800.3 |
It is available in the version you mentioned, maybe do a clean install and check. https://github.com/angular/angular/blob/8.0.2/packages/common/http/src/response.ts |
no success. I tried delete my node_modules. Still getting error: |
@snahmad, you should be importing it from |
What you mean. not clear to me. Kindly elaborate. |
Hi @snahmad , Here is the link for rep https://github.com/2muchcoffeecom/ngx-restangular. |
ok, Thanks, I have wait for ngx-restangular to be updated for angular 8. I need fix in few days. I guess either revert back to angular 6 or 7 or use HttpClient instead of ngx-restangular |
Moving to Angular Package will be a better idea in that case. |
What you mean by |
I was just referring to your comment, where you said "use HttpClient instead of ngx-restangular" |
ok, HttpClient is official angular package, https://angular.io/api/common/http. Let me try to change from ngx-restangular to HttpClient. Only issue will be change RestangularConfigFactory to use HttpClient. // Function for settting the default restangular configuration
RestangularProvider.addFullRequestInterceptor((element, operation, path, url, headers, params) => {
}); RestangularProvider.addErrorInterceptor((response, subject, responseHandler) => { }); |
I am using all these three. import {RestangularModule, Restangular} from 'ngx-restangular'; I guess I can only use HttpClient to do everything. Currently doing getLogSubFiles(folder_name) : Observable<LogFile[]> { I guess I can use HttpClient here instead of restangular |
Yes @snahmad , |
Sure, Thanks. for now Try to fix using ngx-restangular. they claim they have fixed it for angular 8. |
I need help in moving from ngx-restangular to HttpClient. ngx-restangular is broken for latest angular. |
StackOverflow with Angular Tag. |
ok, sure. Can I hire you or some one. I am runout of time. it is big change. |
That's you call, please feel free to do it. |
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. |
🐞 bug report
Affected Package
The issue is caused by package @angular/common/http
Is this a regression?
Yes, the previous version in which this bug was not present was: angular 7.0
Description
after migrating to angular 8.0 using the command
ng update @angular/cli @angular/core
building the application using
ng build --prod
gives the following error:error TS2307: Cannot find module '@angular/common/http/src/response'.
I use this for importing the HttpUploadProgressEvent interface 👍
import { HttpUploadProgressEvent } from '@angular/common/http/src/response';
Should I import it from else where ?
🌍 Your Environment
Angular Version: 8..0
Angular CLI: 8.0.1
Node: 12.3.1
OS: win32 x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.1
@angular-devkit/build-optimizer 0.800.1
@angular-devkit/build-webpack 0.800.1
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cdk 7.3.3
@angular/cli 8.0.1
@ngtools/webpack 8.0.1
@schematics/angular 8.0.1
@schematics/update 0.800.1
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
The text was updated successfully, but these errors were encountered: