-
Notifications
You must be signed in to change notification settings - Fork 14
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
Cannot use in Workers because of process
in userAgent.ts
#658
Comments
process
in userAgent.ts
Thanks for the report. I don't know much about wrangler, I tried a basic module and it failed with |
@therve Thankfully it just got a lot easier to setup & run a worker.
Working workers example
Crashes with
|
Any progress on this? |
I got this working by doing the following making a copy of https://github.com/DataDog/datadog-api-client-typescript/blob/master/packages/datadog-api-client-v1/http/isomorphic-fetch.ts in my project and using it as my own httpApi.
Haven't fully tested it but I got a nice 403 from Datadog. What this does specifically is remove the |
Thanks for your contribution! This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. If you would like this issue to remain open:
|
I can't even use this in the browser due to this. This is caused by some modules importing |
Thanks for your contribution! This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. If you would like this issue to remain open:
|
This is still relevant :) |
👋 hello, we just merged #899 Runtimes where XHR is not available, users will need to supply their own implementation of HttpLibrary. See example implementation with proxy here: https://github.com/DataDog/datadog-api-client-typescript#configure-proxy. This is due to cross-fetch assuming XHR is always present lquixada/cross-fetch#78. Otherwise, you can add polyfils. Looks like |
ok, thank you. I won't do either of those but I appreciate the update |
Another follow up. We just merged #900. This should use native fetch method on non-node environments, omitting the requirement of custom HttpLibrary implementation in environments where XHR is not available. Thanks |
Oh, this sounds perfect. Will this ticket or #900 get updated when there's a release ready with the fix? |
I will update this issue once the next release happens |
Hi all, quick update we just released v1.6.0 |
Describe the bug
I tried running this in a Worker using both Miniflare & Wrangler and they crashed with
ReferenceError: process is not defined
The stack traces point to
datadog-api-client-typescript/userAgent.ts
Line 4 in 62d14a5
To Reproduce
Steps to reproduce the behavior:
npm install @datadog/datadog-api-client
miniflare dev
orwrangler dev
ReferenceError: process is not defined
and process exitExpected behavior
library functions won't crash
process
is missing (e.g. Handle lack of process variable #494)I wasn't sure what the changes to the UA string should be
workers
or some other info about the runtime?Environment and Versions (please complete the following information):
A clear and precise description of your setup:
@datadog/datadog-api-client@1.0.0-beta.9
wrangler@1.19.12
The text was updated successfully, but these errors were encountered: