-
Notifications
You must be signed in to change notification settings - Fork 208
functions.logger.log crashes function if passed certain objects #737
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
Obviously my logging the entire context object is probably incorrect, but it was this way for 2 years until i swapped out all console.log() for functions.logger.log() after upgrading to node 10 |
I attempted to fix and submit a PR, but I ran out of time. If it's not obvious, objects like requests on https functions, or context in callables have circular references in them, so using nodes util.inspect on them would likely solve the issue. The problem is I'm not great at mocha test writing, and I could not come up with a test for when util inspect returns an object reference named [Circular]. That's the object reference itself, NOT the string '[Circular]', so I couldn't get a test working in the short amount of time I allotted myself to work on it. |
This is a little more complex than just using |
@laurenzlong / @mbleigh can we get some movement on this issue please - #776 does fix it but a comment in that PR does raise a concern. |
[REQUIRED] Version info
node: 10
firebase-functions: 3.7.0
firebase-tools: 8.4.3
firebase-admin: 8.12.1
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
I have two scenarios that will reliably crash a firebase function using the logger:
[REQUIRED] Expected behavior
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
Yes
The text was updated successfully, but these errors were encountered: