У меня проблема при сборке проекта prod angular cli с использованием angular 6.
При сборке это дает мне ОШИБКА в Не удается прочитать свойство 'карта' из неопределенного
Я попытался запустить ngc -p tsconfig.json и попал в стек с трассировкой, говоря
Невозможно прочитать свойство 'map' из неопределенного в AotCompiler.loadFilesAsync
в этом методе (файл: @ angular / compiler / fesm5 / compiler.js)
AotCompiler.prototype.loadFilesAsync = function (fileNames, tsFiles) {
var _this = this;
var files = fileNames.map(function (fileName) { return _this._analyzeFile(fileName); });
var loadingPromises = [];
files.forEach(function (file) { return file.ngModules.forEach(function (ngModule) {
return loadingPromises.push(_this._metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false));
}); });
var analyzedInjectables = tsFiles.map(function (tsFile) { return _this._analyzeFileForInjectables(tsFile); });
return Promise.all(loadingPromises).then(function (_) { return ({
analyzedModules: mergeAndValidateNgFiles(files),
analyzedInjectables: analyzedInjectables,
}); });
};
Я приложил файлы package.json и angular-cli.json.
У меня заканчиваются идеи, и я не знаю, куда идти дальше ...
Заранее спасибо.
package.json
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.10",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.1.9",
"@angular/compiler": "^6.1.9",
"@angular/core": "^6.1.9",
"@angular/flex-layout": "6.0.0-beta.18",
"@angular/forms": "^6.1.9",
"@angular/http": "^6.1.9",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.9",
"@angular/platform-browser-dynamic": "^6.1.9",
"@angular/router": "^6.1.9",
"@auth0/angular-jwt": "latest",
"angular-font-awesome": "^3.1.2",
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
"moment": "^2.22.2",
"ng2-charts": "^1.6.0",
"ng2-toastr": "^4.1.2",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.8.26",
"hammerjs": "^2.0.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.12.4",
"@angular/cli": "^7.3.0",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "^2.9.2"
}
}
angular.json
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"projectName": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
"src/img"
],
"styles": [
{
"input":"src/css/someStyle.scss"
},
"src/css/styles.css",
"node_modules/font-awesome/css/font-awesome.css"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "projectName:build"
},
"configurations": {
"production": {
"browserTarget": "projectName:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "projectName:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"src/css/styles.css"
],
"assets": [
"src/assets",
"src/favicon.ico",
"src/img"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"projectName-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "projectName:serve"
},
"configurations": {
"production": {
"devServerTarget": "provider:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "projectName",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
ПОСЛЕДНЕЕ РЕДАКТИРОВАНИЕ:
я запускаю сборку с --aot = false --build-optimizer = false, что странно ...