Впервые задаю вопрос здесь и, вероятно, не последний.
Проблема: Процесс ng-build --prod
не может завершиться sh и ошибки в моем приложении Angular 8.2.14. Я использую Firebase и смог установить его в своем проекте до точки, где я получаю данные и передаю их в HTML. При попытке собрать для производства, чтобы я мог развернуть его в Heroku, я получаю несколько ERROR in ./src/app/app.module.ngfactory.js
ошибок с вещами, связанными с Firebase, которых нет в упомянутой в них библиотеке Firebase.
ERROR in ./src/app/app.module.ngfactory.js 28:2969-2998
"export 'FirebaseNameOrConfigToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:3098-3127
"export 'FirebaseNameOrConfigToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:6418-6447
"export 'FirebaseNameOrConfigToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:2928-2952
"export 'FirebaseOptionsToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:3068-3092
"export 'FirebaseOptionsToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:6031-6055
"export 'FirebaseOptionsToken' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:3134-3157
"export 'RealtimeDatabaseURL' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
//----------
ERROR in ./src/app/app.module.ngfactory.js 28:2902-2925
"export '_firebaseAppFactory' (imported as 'i13') was not found in '@angular/fire'
at HarmonyImportSpecifierDependency._getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1425:22)
at hooks.finishModules.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1221:10)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1216:28)
at hooks.make.callAsync.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compiler.js:662:17)
at _done (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at _err1 (eval at create (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:36:22)
at _addModuleChain (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1148:12)
at processModuleDependencies.err (/Users/sean.swanson/Desktop/Swan/dev/break-trainer/node_modules/webpack/lib/Compilation.js:1060:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ ./src/main.ts
@ multi ./src/main.ts
Я довольно новичок в Angular и использовал CLI для генерации моего проекта, а также для создания компонентов внутри. Я попытался удалить свою папку node_modules и сделал npm install
на случай, если это была проблема с кэшированием. Я следовал указаниям по установке @ angular / compiler и @ angular / compiler-cli до 6.1.1 для некоторых проблем, связанных с https://github.com/ngx-rocket/generator-ngx-rocket/issues/366, но не повезло.
Любое понимание здесь будет полезно! Спасибо за чтение.
Моя посылка. json:
{
"name": "break-trainer",
"version": "0.0.0",
"engines": {
"node": "6.13.4",
"npm": "3.10.10"
},
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"heroku-postbuild": "ng build --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.2.14",
"@angular/cli": "~8.3.23",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "~8.2.14",
"@angular/fire": "^6.0.0-rc.1",
"@angular/forms": "~8.2.14",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"angularfire": "^2.3.0",
"angularfire2": "^5.4.2",
"express": "^4.17.1",
"firebase": "^7.9.1",
"path": "^0.12.7",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"typescript": "~3.5.3",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/architect": "^0.900.0-0 || ^0.900.0",
"@angular-devkit/build-angular": "~0.803.23",
"@angular/cli": "~8.3.23",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "~8.2.14",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"enhanced-resolve": "^3.3.0",
"firebase-tools": "^7.12.1",
"fuzzy": "^0.1.3",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"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.5.3"
}
}