skip to Main Content

When I build the project the issue has occurred

Error

ERROR in node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav.d.ts(1,10): error TS2305: Module ‘”C:/Users/amare/Desktop/New folder/tb/node_modules/@angular/router/router”‘ has no exported member ‘QueryParamsHandling’.

package.json

  "name": "@coreui/coreui-free-angular-admin-template",
  "version": "2.4.5",
  "description": "CoreUI Free Angular 2+ Admin Template",
  "author": {
    "name": "Łukasz Holeczek",
    "url": "http://holeczek.pl",
    "github": "https://github.com/mrholek",
    "twitter": "https://twitter.com/lukaszholeczek"
  },
  "contributors": [
    {
      "name": "Andrzej Kopański",
      "url": "https://github.com/xidedix"
    }
  ],
  "homepage": "https://coreui.io/angular",
  "copyright": "Copyright 2018 creativeLabs Łukasz Holeczek",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod --aot --buildOptimizer --commonChunk --vendorChunk --optimization --progress",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.10",
    "@angular/common": "^7.2.10",
    "@angular/compiler": "^7.2.10",
    "@angular/core": "^7.2.10",
    "@angular/forms": "^7.2.10",
    "@angular/http": "^7.2.10",
    "@angular/platform-browser": "^7.2.10",
    "@angular/platform-browser-dynamic": "^7.2.10",
    "@angular/router": "^7.2.10",
    "@coreui/angular": "^2.4.5",
    "@coreui/coreui": "^2.1.8",
    "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
    "@coreui/icons": "0.3.0",
    "ag-grid-angular": "^20.2.0",
    "ag-grid-community": "^20.2.0",
    "angular-gauge-chart": "^0.6.0",
    "angular-jwt": "^0.1.11",
    "angular2-jwt": "^0.2.3",
    "bootstrap": "^4.3.1",
    "chart.js": "^2.8.0",
    "core-js": "^2.6.5",
    "file-saver": "^2.0.1",
    "flag-icon-css": "^3.3.0",
    "font-awesome": "^4.7.0",
    "jspdf": "^1.5.3",
    "jspdf-autotable": "^3.1.1",
    "moment": "^2.24.0",
    "mutationobserver-shim": "^0.3.3",
    "ng2-charts": "^1.6.0",
    "ngx-bootstrap": "^3.2.0",
    "ngx-perfect-scrollbar": "^7.2.1",
    "ngx-toastr": "^10.0.4",
    "rxjs": "^6.4.0",
    "simple-line-icons": "^2.4.1",
    "ts-helpers": "^1.1.2",
    "tsickle": "^0.34.3",
    "tslib": "^1.9.0",
    "xlsx": "^0.14.2",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.6",
    "@angular/cli": "^7.3.6",
    "@angular/compiler-cli": "^7.2.10",
    "@angular/language-service": "^7.2.10",
    "@types/jasmine": "^3.3.12",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^11.11.4",
    "codelyzer": "^4.5.0",
    "jasmine-core": "^3.3.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.0.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "^5.4.2",
    "ts-node": "^8.0.3",
    "tslint": "^5.14.0",
    "typescript": "~3.2.4"
  },
  "engines": {
    "node": ">= 8.9.4",
    "npm": ">= 5.6.0"
  }
}

When I build the project the issue has occurred

Error

ERROR in node_modules/@coreui/angular/lib/sidebar/app-sidebar-nav.d.ts(1,10): error TS2305: Module ‘”C:/Users/amare/Desktop/New folder/tb/node_modules/@angular/router/router”‘ has no exported member ‘QueryParamsHandling’.

3

Answers


  1. I also faced same issue and this worked for me.
    Use this version of coreui – “@coreui/angular”: “2.5.3”

    Look like the QueryParamsHandling is not referred in this version as per code of this version.

    Also if you have already run npm install then you need to remove it manually then add it again with version 2.5.3 and make sure you have mentioned exact version in your package.json (without cart or tilde symbol).

    Login or Signup to reply.
  2. Changing @coreui/angular version didn’t work for me,
    but changing import statement in the [email protected] file to :

    import { QueryParamsHandling } from '@angular/router/src/config';
    

    will immediately work.

    Login or Signup to reply.
  3. I managed to solve it like this. Go to @ angular / router / router "and insert the word ‘export’ before the QueryParamsHandling declaration:

    export declare type QueryParamsHandling = ‘merge’ | ‘preserve’ | ”;

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search