angularfire: enableProdMode stops AngularFirePerformanceModule?
Version info
“@angular/animations”: “~9.1.0”, “@angular/cdk”: “~9.2.0”, “@angular/common”: “~9.1.0”, “@angular/compiler”: “~9.1.0”, “@angular/core”: “~9.1.0”, “@angular/fire”: “^6.0.0”, “@angular/forms”: “~9.1.0”, “@angular/material”: “^9.2.0”, “@angular/platform-browser”: “~9.1.0”, “@angular/platform-browser-dynamic”: “~9.1.0”, “@angular/platform-server”: “~9.1.0”, “@angular/router”: “~9.1.0”, “firebase”: “^7.14.6”,
Other (e.g. Ionic/Cordova, Node, browser, operating system): browser
How to reproduce these conditions
I have multiple environments: integration, testing, staging, production. AngularFirePerformanceModule doesn’t seem to work in anything except for integration. The only difference between these environments is the environment variables, and the only one that I can think of that makes materially differences is the enableProdMode
from production: true
.
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
see above. 1 project, 2 env variables
Sample data and security rules export const environment = { production: false }
vs
export const environment = { production: true }
Debug output
** Errors in the JavaScript console ** no console log errors
** Output from firebase.database().enableLogging(true);
**
not db related
** Screenshots ** can’t show screenshots of working performance for other reasons
Expected behavior
performance logged
Actual behavior
doesn’t even show that the sdk is setup. contacted google support and they say they haven’t gotten anything from this project (in production)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 19 (11 by maintainers)
I think that tree shaking is the issue. My workaround: use a custom trace somewhere at startup (eg logon), then also the non-custom/built-in traces seem to work fine!
While I verified that the changes in PR https://github.com/angular/angularfire/pull/2595 alone fixed this, I didn’t test PR https://github.com/angular/angularfire/pull/2597 locally. Now that
6.0.3
is released and I’ve tested it on a few sites, I can confirm that this is not fixed. I am still not getting Firebase Performance logs sent to the server from any of the apps.It looks like maybe this was actually needed?
Will be fixed in
6.0.3
which should be up on NPM shortly.Yeah, looks like this is the case https://github.com/angular/angularfire/commit/ae0ef48a78318907cc9307f4ca167bea8ef7d21e#diff-473350a8df09472fdfe71659bcae05daR36 the logic with the “default” was broken in that commit. If it’s
null
, which is what an@Optional
defaults to, it will disable metrics. I’m testing, will cut an RC with a fix for this and the analytics shortly.@jonbcampos-alto I think I’m having the same issue as you. My performance monitoring was logging just fine in the Firebase dashboard up until a couple months ago. Now nothing is being sent over. Do we have to include PerformanceMonitoringService as a provider now since v6?