-
Notifications
You must be signed in to change notification settings - Fork 142
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
Importing module @datadog/browser-logs
breaks on Google Cloud Platform
#1764
Comments
Hi @r3c, To clarify, when you're saying running from a Google Cloud Platform environment, are you talking about a Node.js backend environment? |
Hello @amortemousque not sure about Node.js exactly but it's very likely a backend V8 execution platform. I couldn't find much details and will try to dig this through, yet I expect it to be fully compatible with a Node.js environment. |
Your current supposition is true. |
OK then I think I was confused by the part in your README file that mentions "other Javascript clients". Using the same library for browers and Node.js allowed us easier factorization, but I understand this may not be aligned with the intended usage of this package so we'll split the codebase on our end. Thanks for your answer 🙂 (I would also recommand updating README.md to avoid any confusion 🙂) |
Thanks for your feedback, we will update the README.md 🙂 |
Hi,
We're experiencing an issue related to
@datadog/browser-logs
crashing when running from a Google Cloud Platform environment due to the side-effects it performs when imported, namely the binding operations onconsole.{debug,log,info,warn,error}
executed at top-level from module display.ts.This file contains top-level code assuming it runs in a browser and calls
Function.bind
for all known logging methods ofconsole
object. Such approach works fine in most web browser but breaks on our application hosted on Google Cloud Platform because the implementation ofconsole
there doesn't have aconsole.debug
function. I believe this regression was introduced with #1501 as onlywarn
,log
anderror
were previously used and they all exist in GCP.Current behavior may be intentional and rely on the fact
@datadog/browser-logs
always runs within a standard web browser, which would be a fair assumption based on the package's name. However since the package description says it is intended to "send logs to Datadog from web browsers or other Javascript clients", you may also want to consider improving compatibility by checking the existence ofconsole.debug
(and other functions) before trying to bind them.Please let me know what makes most sense to you 🙂
The text was updated successfully, but these errors were encountered: