1

I have recently upgraded my application from angular 9 to 14, there are two internal libraries build by a separate team which seems to be working fine with newly created angular 14 application, but not with the upgraded one. I have been getting errors related the modules imported by the library as ./node_modules/razor-client-tagging-lib/fesm2020/razor-client-tagging-lib.mjs:59:0-29 - Error: Module not found: Error: Can't resolve 'xlsx' in 'C:\Users\sahil.agarwal\Desktop\projects\cmtk-lme\node_modules\razor-client-tagging-lib\fesm2020' when I try to run application using "ng serve".

Below is the package.json:

{
  "name": "cmtk-lme",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "build:elements": "ng build --configuration production --aot --output-hashing=all"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.1.3",
    "@angular/cdk": "^13.3.9",
    "@angular/cli": "^14.1.3",
    "@angular/common": "^14.1.3",
    "@angular/compiler": "^14.1.3",
    "@angular/core": "^14.1.3",
    "@angular/elements": "^14.1.3",
    "@angular/forms": "^14.1.3",
    "@angular/material": "^13.3.9",
    "@angular/platform-browser": "^14.1.3",
    "@angular/platform-browser-dynamic": "^14.1.3",
    "@angular/router": "^14.1.3",
    "@ng-idle/core": "^8.0.0-beta.4",
    "@ng-idle/keepalive": "^8.0.0-beta.4",
    "@ng-select/ng-select": "^3.7.3",
    "@ngx-formly/bootstrap": "^5.0.0",
    "@ngx-formly/core": "^5.0.0",
    "@ngx-formly/schematics": "^5.5.15",
    "@types/atmosphere.js": "^2.1.2",
    "@videogular/ngx-videogular": "^4.0.1",
    "anychart": "^8.11.0",
    "atmosphere.js": "^3.0.0",
    "bootstrap": "^4.4.1",
    "chart.js": "^4.0.1",
    "document-register-element": "^1.7.2",
    "font-awesome": "^4.7.0",
    "jquery": "^3.5.0",
    "lodash": "^4.17.15",
    "moment": "^2.29.4",
    "ng2-pdf-viewer": "^6.4.1",
    "ng5-slider": "^1.2.4",
    "ngx-extended-pdf-viewer": "^7.3.1",
    "ngx-smart-popover": "^1.4.0",
    "ngx-virtual-scroller": "^4.0.3",
    "popper.js": "^1.16.1",
    "primeicons": "^6.0.1",
    "primeng": "^14.2.1",
    "razor-client-tagging-lib": "^1.0.2",
    "razor-redact-lib": "^1.0.2",
    "rxjs": "~6.6.7",
    "save": "^2.4.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.2.9",
    "@angular/compiler-cli": "^14.1.3",
    "@angular/language-service": "^14.1.3",
    "@types/core-js": "^2.5.4",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/lodash": "^4.14.149",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "concat": "^1.0.3",
    "fs-extra": "^9.0.1",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~6.4.1",
    "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": "~7.0.0",
    "ts-node": "~7.0.0",
    "tslint": "~6.1.3",
    "typescript": "~4.6.4"
  }
}

What is wrong I am doing in here?

Sahil Agarwal
  • 79
  • 1
  • 11

1 Answers1

0

You have to install the xlsx library. To install, run the below command:

npm install xlsx

samnoon
  • 1,340
  • 2
  • 13
  • 23