question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: HttpClientModule has not been processed correctly by ngcc, Http module failed to import in Ionic v5.0.4 with Angular Core v9.0.5

See original GitHub issue

Bug Report

Ionic version:

[x] 5.x

Steps to reproduce:

I am trying to import

import { HttpClientModule } from '@angular/common/http';'

in app.module.ts and later in

imports: [
    BrowserModule, 
    HttpClientModule,
    IonicModule.forRoot(), 
    AppRoutingModule
  ],

and there is a bug

ERROR in node_modules/@angular/common/http/http.d.ts:2801:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
[ng]     
[ng]     This likely means that the library (@angular/common/http) which declares HttpClientModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
[ng]     
[ng]     2801 export declare class HttpClientModule {

Ionic info:

My Ionic App Package.json

"dependencies": {
    "@angular/common": "~9.0.5",
    "@angular/core": "~9.0.5",
    "@angular/forms": "~9.0.5",
    "@angular/platform-browser": "~9.0.5",
    "@angular/platform-browser-dynamic": "~9.0.5",
    "@angular/router": "~9.0.5",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^5.0.4",
    "core-js": "^2.5.4",
    "rxjs": "~6.5.1",
    "tslib": "^1.10.0",
    "woocommerce-api": "^1.5.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.5",
    "@angular/cli": "~9.0.5",
    "@angular/compiler": "~9.0.5",
    "@angular/compiler-cli": "~9.0.5",
    "@angular/language-service": "~9.0.5",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.7.5"
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
samiviccommented, Mar 29, 2020

Try npm cache clean --force

2reactions
christianemmanuelcommented, Mar 30, 2020

Thanks @samivic it’s seems working from my end 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpClientModule import error (could not be resolved to an ...
module.ts file in the imports section. To solve this problem I just removed the HttpModule import from the app module and it fixed...
Read more >
Getting Error with Httpclient Module In Angular
bug : HttpClientModule has not been processed correctly by ngcc Http module failed to import in Ionic v5.0.4 with Angular Core v9.0.5 #20716....
Read more >
inject() must be called from an injection context at ...
Solution: use projects.$name.architect.build.options.preserveSymlinks: true in the angular.json file of the client project, not the library. Further information ...
Read more >
Dont work HTTP module - ionic-v3
The application is created on Ionic 3. ... But still it does not work. ... import { HttpClientModule } from '@angular/common/http';.
Read more >
ionic-native-http-connection-backend/README.md
Even though there is a way to solve CORS issue without changing server's response header by using [Cordova HTTP plugin](https://ionicframework.com/docs/native/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found