web-dev-qa-db-fra.com

Impossible de lire «type» de la propriété non définie tout en publiant le projet angulaire + .NET CORE dans CI-CD Azure Devops

lors de l'exécution de NG Build --Prod de commandes dans les étapes CI-CD (publication), nous obtenons l'erreur suivante.


  • erreur in ./node_modules/ng-multiselect-dropdown/fesm5/ng-multiselect-dropdown.js Module Cuilule a échoué (à partir de ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack - LOADER.JS): TypeError: Impossible de lire la propriété 'type' de non défini

voici mon paquet.json pour référence de dépendance.

{
"name": "XYZ",
"version": "7.1.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"publish": "ng build --prod",
"start": "ng serve --Host 0.0.0.0 --port 4200",
"hmr": "ng serve --Host 0.0.0.0 --port 4200 --hmr",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
  },
"private": false,
"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/platform-browser": "^8.0.0",
"@angular/platform-browser-dynamic": "^8.0.0",
"@angular/platform-server": "^8.0.0",
"@angular/router": "^8.0.0",
"@aspnet/signalr": "^1.1.4",
"@swimlane/ngx-charts": "^12.0.1",
"abp-ng2-module": "^4.0.0",
"abp-web-resources": "^3.8.5",
"adal-angular": "^1.0.17",
"angular2-counto": "^1.2.5",
"angular2-template-compiler": "^0.1.9",
"angular2-text-mask": "^9.0.0",
"animate.css": "^3.7.1",
"chart.js": "^2.8.0",
"cookieconsent": "^3.1.1",
"core-js": "^3.1.3",
"famfamfam-flags": "^1.0.0",
"jquery": "^3.4.1",
"js-cookie": "^2.2.0",
"localforage": "^1.7.3",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"moment-timezone": "^0.5.25",
"ng-multiselect-dropdown": "^0.2.5",
"ng-recaptcha": "^4.3.0",
"ng2-file-upload": "^1.3.0",
"ng2-search-filter": "^0.5.1",
"ngx-bootstrap": "^4.3.0",
"ngx-daterangepicker-material": "^2.1.8",
"ngx-image-cropper": "^1.3.10",
"ngx-perfect-scrollbar": "^7.2.1",
"object-path": "^0.11.4",
"oidc-client": "^1.9.1",
"primeicons": "^1.0.0",
"primeng": "^8.0.0",
"Push.js": "^1.0.9",
"quill": "^1.3.6",
"rtl-detect": "^1.0.2",
"rxjs": "^6.5.3",
"simple-line-icons": "^2.4.1",
"sweetalert2": "^8.11.6",
"text-mask-addons": "^3.8.0",
"volo-angular-oauth2-oidc": "^5.0.2",
"zone.js": "~0.9.1",
"webpack-dev-server": "^3.1.5"


  },
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.1",
"@angular/cli": "^8.0.1",
"@angular/compiler-cli": "^8.0.0",
"@angularclass/hmr": "^2.1.3",
"@angularclass/hmr-loader": "^3.0.4",
"@types/jasmine": "~3.3.13",
"@types/jasminewd2": "~2.0.6",
"@types/jquery": "^3.3.31",
"@types/lodash": "^4.14.133",
"@types/moment-timezone": "^0.5.12",
"@types/node": "^12.0.4",
"codelyzer": "^5.0.1",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"nswag": "12.3.1",
"protractor": "~5.4.2",
"ts-node": "~8.2.0",
"tslint": "~5.17.0",
"TypeScript": "3.4.5",
"webpack-cli": "^3.1.0"
  }
}
6
bhagwat kushwaha

J'avais le même problème et résolu en changeant le buildoptimizer: Faux dans le fichier angular.json.

pas besoin de dégradation

juste changer

buildOptimizer: true

to

buildOptimizer: false

travaillé pour moi

2
Siraj Ali