-
Notifications
You must be signed in to change notification settings - Fork 2.2k
enableProdMode stops AngularFirePerformanceModule? #2502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Perhaps the same as #2505, see my comment on that thread for a possible work around. |
Using the below code in app.component is registering all the logs in production mode |
@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? |
based on the thread it looks like the tree shaking is overly aggressive and
stopping this functionality from working. until there is a fix I think the
only option is to turn prod: false. which I don't recommend.
…On Thu, Jul 16, 2020 at 10:51 AM Kyle Abens ***@***.***> wrote:
@jonbcampos-alto <https://github.com/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?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2502 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKJW2HWGZMRTJIB7N4NPLALR34OX3ANCNFSM4N5COB7A>
.
--
Jonathan Campos
CTO and Vice-President Of Engineering
E: [email protected] | W: ridealto.com
P: 214-682-4070
900 Dragon St. Suite 100
Dallas, TX 75207
<https://www.facebook.com/ridealto/> <https://www.instagram.com/ridealto/>
<https://www.linkedin.com/company/ridealto/>
<https://twitter.com/ridealto?lang=en>
|
Here my solution:
|
tested @madHorse54 's solution. no effect. |
Yeah, looks like this is the case ae0ef48#diff-473350a8df09472fdfe71659bcae05daR36 the logic with the "default" was broken in that commit. If it's |
Yeah, I saw that too but I ran into some issues trying to get the full cycle of build lib, yarn in sample project, ng serve in sample project, etc to see the changes. I haven't found any contributor docs that explain how to best do this development cycle for this project. It seems like I need to |
- if the app doesn't inject anything and the values are `null`, then we should enable instrumentation and data collection by default Fixes angular#2502
Posted PR #2595 to solve this after I was finally able to verify the fix locally. |
In the meantime, I tried this workaround, but it didn't work for me. I also tried applying the fix in my |
Will be fixed in |
While I verified that the changes in PR #2595 alone fixed this, I didn't test PR #2597 locally. Now that It looks like maybe this was actually needed? |
Sorry to confirm that it is NOT fixed. I built a completely new angular app from scratch with v6.0.3 and performance data is only logged when I deploy with: but not with: -----------Update----------- |
Any update on this or workarounds for the time being with v6.0.3? |
I think that tree shaking is the issue. |
Thank you for this information. @jamesdaniels I was able to confirm that this is the case. Just adding a simple start/stop trace in your |
Odd... |
@jamesdaniels initially I tried in an app to just do Then I tried this.angularFirePerformance.trace('app-component-trace').then((trace: Trace) => {}); And that seemed to be tree shaken too. I finally settled on the following to make it start working: trace: Trace | null = null;
constructor(private angularFirePerformance: AngularFirePerformance) {
this.angularFirePerformance.trace('app-component-trace').then((trace: Trace) => {
trace.start();
this.trace = trace;
});
}
ngOnInit(): void {
if (this.trace) {
this.trace.stop();
}
} I didn't use |
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
fromproduction: 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)
The text was updated successfully, but these errors were encountered: