Closed smarth55 closed 3 years ago
So, I found that the reason the for the missing/weird dependancies is because firebase-tools
was not updated. Odd too is that after updating using ng update @angular/fire
, looking at the package.json for @angular/fire and looking in my package-lock.json, the only dependency listed is tslib.
From my lock file:
"@angular/fire": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@angular/fire/-/fire-6.0.2.tgz",
"integrity": "sha512-r59v7XD2oNN1oJghRMcph+PVqJj49aQnQevArOU4ldW07K0t9k2Ud8ALO/z3iNvMOBkumenGlYSS/h3v4foLBg==",
"requires": {
"tslib": "^1.10.0"
},
"dependencies": {
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
}
}
}
And the generated package.json for @angular/fire in my node_modules:
{
"$schema": "../node_modules/ng-packagr/package.schema.json",
"_from": "@angular/fire@^6.0.2",
"_id": "@angular/fire@6.0.2",
"_inBundle": false,
"_integrity": "sha512-r59v7XD2oNN1oJghRMcph+PVqJj49aQnQevArOU4ldW07K0t9k2Ud8ALO/z3iNvMOBkumenGlYSS/h3v4foLBg==",
"_location": "/@angular/fire",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@angular/fire@^6.0.2",
"name": "@angular/fire",
"escapedName": "@angular%2ffire",
"scope": "@angular",
"rawSpec": "^6.0.2",
"saveSpec": null,
"fetchSpec": "^6.0.2"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/@angular/fire/-/fire-6.0.2.tgz",
"_shasum": "6c391128496f4fa16afba436a7a57a25e3e510f1",
"_spec": "@angular/fire@^6.0.2",
"_where": "path/to/project",
"author": {
"name": "angular,firebase"
},
"bugs": {
"url": "https://github.com/angular/angularfire2/issues"
},
"builders": "./builders.json",
"bundleDependencies": false,
"dependencies": {
"tslib": "^1.10.0"
},
"deprecated": false,
"description": "The official library for Firebase and Angular",
"es2015_ivy_ngcc": "__ivy_ngcc__/fesm2015/angular-fire.js",
"es2015": "fesm2015/angular-fire.js",
"esm2015": "esm2015/angular-fire.js",
"fesm2015_ivy_ngcc": "__ivy_ngcc__/fesm2015/angular-fire.js",
"fesm2015": "fesm2015/angular-fire.js",
"homepage": "https://github.com/angular/angularfire2#readme",
"keywords": [
"angular",
"firebase",
"rxjs",
"angularfire",
"angularfire2"
],
"license": "MIT",
"main": "bundles/angular-fire.umd.js",
"metadata": "angular-fire.metadata.json",
"module_ivy_ngcc": "__ivy_ngcc__/fesm2015/angular-fire.js",
"module": "fesm2015/angular-fire.js",
"name": "@angular/fire",
"peerDependencies": {
"@angular/common": "^9.0.0 || ^10.0.0",
"@angular/core": "^9.0.0 || ^10.0.0",
"@angular/platform-browser": "^9.0.0 || ^10.0.0",
"@angular/platform-browser-dynamic": "^9.0.0 || ^10.0.0",
"firebase": "^7.13.1",
"rxjs": "^6.5.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angularfire2.git"
},
"schematics": "./collection.json",
"sideEffects": false,
"typings": "angular-fire.d.ts",
"version": "6.0.2",
"__processed_by_ivy_ngcc__": {
"es2015": "10.0.2",
"fesm2015": "10.0.2",
"module": "10.0.2",
"typings": "10.0.2"
},
"scripts": {
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by NGCC. This is not allowed.\\nPlease delete and rebuild the package, without compiling with NGCC, before attempting to publish.\\nNote that NGCC may have been run by importing this package into another project that is being built with Ivy enabled.\\n')\" && exit 1"
}
}
I also ran into this issue. Since I didn´t have the time for troubleshooting my workaround was directly running the following command in the console:
ng build --prod && firebase deploy --only hosting
Alternatively, you can also add this command to your package.json
like this:
"scripts": {
"deploy-prod": "ng build --prod && firebase deploy --only hosting"
},
And then run npm run deploy-prod
in the console.
Closing as there's a work around, def looks like a firebase-tools incompatibility to me. Hopefully these are mostly shaken out by now. Perhaps I should add a version check / warning...?
Version info
Angular: 10.0.1 Firebase: 7.15.5 AngularFire: 6.0.2 Other (e.g. Ionic/Cordova, Node, browser, operating system): node: 12.14.0
How to reproduce these conditions
I updated angular, material, and fire using the
ng update
command and then tried to run the deploy command.Steps to set up and reproduce Here is the package.json file that I have after updating using the cli
running
npm install
and then trying to use the @angualr/fire deploy command will result in the missing dependency error. It looks like https://github.com/angular/angularfire/blob/master/src/schematics/deploy/actions.ts#L245 is where this was added, buttriple-beam
is nowhere in the dependency tree. The addition of that code also assumes thatwinston
is installed and it is becausefirebase
lists it as a dep, but no mention oftriple-beam
.Adding it manually fixes the issue.Actually, there is an additional errorCannot read property 'printf' of undefined
caused by https://github.com/angular/angularfire/blob/master/src/schematics/deploy/actions.ts#L250. This looks to be becausefirebase-tools
is requiring verison ^1.0.1 of winston and a newer version is not being required by @angular/fire.Debug output
Cannot find module 'triple-beam'
Expected behavior
The build to be deployed
Actual behavior
console error: Cannot find module 'triple-beam'