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

ngx-restanular error in angular 8 #168

Closed
kamaruzzaman opened this issue Jun 5, 2019 · 19 comments
Closed

ngx-restanular error in angular 8 #168

kamaruzzaman opened this issue Jun 5, 2019 · 19 comments

Comments

@kamaruzzaman
Copy link
Contributor

After upgrading my project to Angular 8, I am getting the following error from ngx-restangular:

ERROR in node_modules/ngx-restangular/lib/ngx-restangular-http.d.ts(3,27): error TS2307: Cannot find module '@angular/common/http/src/response'.

It would be nice if you fix the Issue so that ngx-restangular can be used with angular 8

kamaruzzaman added a commit to kamaruzzaman/ngx-restangular that referenced this issue Jun 5, 2019
@kamaruzzaman
Copy link
Contributor Author

I have upgraded ngx-restangular to angular 8 in the branch:

https://github.com/kamaruzzaman/ngx-restangular/tree/Issue_168_angular8

@jc950
Copy link

jc950 commented Jun 14, 2019

Is there a merge and an npm publish planned ?

@tairezzzz
Copy link
Collaborator

working on it

@jc950
Copy link

jc950 commented Jun 14, 2019

Thank you !

rshchpkn added a commit that referenced this issue Jun 25, 2019
@jcheros
Copy link

jcheros commented Jul 4, 2019

I have upgraded ngx-restangular to angular 8 in the branch:

https://github.com/kamaruzzaman/ngx-restangular/tree/Issue_168_angular8

After installing from this branch the module import fails:

import { RestangularModule } from 'ngx-restangular'; -> error TS2307: Cannot find module 'ngx-restangular'.

@hijamoya
Copy link

hijamoya commented Jul 5, 2019

Same issue here..

@snahmad
Copy link

snahmad commented Jul 11, 2019

Is this fixed.

I am getting as well.
ERROR in node_modules/ngx-restangular/lib/ngx-restangular-http.d.ts(3,27): error TS2307: Cannot find module '@angular/common/http/src/response'.

How get I can updated ngx-restangular.

@snahmad
Copy link

snahmad commented Jul 12, 2019

Any resolution on this issue using with latest angulr 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'.

@jcheros
Copy link

jcheros commented Jul 12, 2019

Any resolution on this issue using with latest angulr 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'.

Try with 5.0.0-rc1

@snahmad
Copy link

snahmad commented Jul 12, 2019

I installed

npm install ngx-restangular@5.0.0-rc1 --save

but now getting different errors.

ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/array' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/date' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/function' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/map' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/math' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/number' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/object' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/parse-float' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/parse-int' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/regexp' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/set' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/string' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/symbol' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es6/weak-map' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./node_modules/ngx-restangular/fesm5/ngx-restangular.js
Module not found: Error: Can't resolve 'core-js/fn/object' in 'C:\Work\Actisense\W2K1\angular\webApp\node_modules\ngx-restangular\fesm5'

@jcheros
Copy link

jcheros commented Jul 12, 2019

I installed

npm install ngx-restangular@5.0.0-rc1 --save

but now getting different errors.

Maybe you need to update your Angular Cli.
My package.json looks like this

"dependencies": {
    "@angular/animations": "^8.0.0",
    "@angular/cdk": "^8.0.0",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
    "@angular/material": "^8.0.0",
    "@angular/material-moment-adapter": "^8.0.0",
    "@angular/platform-browser": "^8.0.0",
    "@angular/platform-browser-dynamic": "^8.0.0",
    "@angular/pwa": "^0.800.3",
    "@angular/router": "^8.0.0",
    "@angular/service-worker": "^8.0.0",
    "core-js": "2.5.1",
    "ngx-restangular": "5.0.0-rc1",
    "rxjs": "6.5.2",
    "rxjs-compat": "6.3.0",
    "zone.js": "~0.9.1",
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.2",
    "@angular/cli": "^8.0.2",
    "@angular/compiler-cli": "^8.0.0",
    "@angular/language-service": "8.0.0",
    ...
    "tslint-language-service": "^0.9.9",
    "typescript": "3.4.5"
  }

@snahmad
Copy link

snahmad commented Jul 15, 2019

I have moved to ngx-restangular latest version.
using now ngx-restangular": "^5.0.0-rc1",
now getting

Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./node_modules/ngx-restangular/fesm5/ngx-restangular.js
Module not found: Error: Can't resolve 'core-js/fn/object' in 'C:\Work\Actisense\W2K1\angular\webApp\node_modules\ngx-restangular\fesm5'

@snahmad
Copy link

snahmad commented Jul 16, 2019

any idea?

how to fix it.
Should I move back to angular 6 or 7.

@bal3no
Copy link
Contributor

bal3no commented Aug 22, 2019

Finally I found a solution to work with ngx-restangular 5.0.0-rc1, angular 8.2.3 and core-js 3.2.1. First of all, to solve the error
"Can't resolve 'core-js/es7/reflect'"
I had to change the import in my polyfill.ts to "core-js/es/reflect".

Next, I got a similar error in ngx-restangular
Module not found: Error: Can't resolve 'core-js/fn/object' (same as @snahmad)
and had to change the line
import { assign } from 'core-js/fn/object'; to
import { assign } from 'core-js/features/object';
in ngx-restangular/fesm5/ngx-restangular.js

This worked for me ... but how to have the correction inside the ngx-restangular package?

UPDATE: I've made my first try to make a PR ...

@rshchpkn
Copy link
Collaborator

Hi, thanks to the @bal3no PR I published a new version under rc tag. To install use npm install ngx-restangular@rc

@rshchpkn
Copy link
Collaborator

Published 5.0.0 version. Please notify me if there are any issues

@akvaliya
Copy link

akvaliya commented Sep 2, 2019

I am getting this error ERROR in ./node_modules/ngx-restangular/fesm2015/ngx-restangular.js Module not found: Error: Can't resolve 'core-js/features/object'
My project has "core-js": "^2.6.4"

@zzhou718
Copy link

zzhou718 commented Sep 2, 2019

@akvaliya please update your ngx-restangular to 5.0.0 (not 5.0.0-rc1) and core-js to 3.2.1. I saw this issue as well on August 29 and solved it by doing so.

@soutionscience
Copy link

I have moved to ngx-restangular latest version.
using now ngx-restangular": "^5.0.0-rc1",
now getting

Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'C:\Work\Actisense\W2K1\angular\webApp\src'
ERROR in ./node_modules/ngx-restangular/fesm5/ngx-restangular.js
Module not found: Error: Can't resolve 'core-js/fn/object' in 'C:\Work\Actisense\W2K1\angular\webApp\node_modules\ngx-restangular\fesm5'

solved the issue by installing the running npm i core-js@3

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

No branches or pull requests