[GH-ISSUE #3998] Same telemetry issue breaking non-node.js environments #27115

Closed
opened 2026-04-17 17:56:09 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @lucasoliveirabr on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3998

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Create a backend project with Cloudflare Workers and Hono and try to run it without Workers support for Node.js.

Update from the previous issue: Now the project runs and keep on, but when I make any kind of call to my API (Better Auth routes and other routes), it throws this error:

Console:
X [ERROR] ReferenceError: process is not defined

Current vs. Expected behavior

Until v1.3.4, Better Auth worked normally with non-node.js environments. Now with v1.3.5 (v.1.3.6 and v.1.3.7-beta.1) with the addition of built-in node.js modules to make telemetry work, it's not possible to run it unless adding node.js support to the environment, which isn't possible or desirable in some cases.

What version of Better Auth are you using?

v.1.3.7-beta.1

System info

OS: Windows
Framework: Hono
Environment: Cloudflare Workers

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)


Additional context

Same issue from 3945 and 3973 that were closed.

Originally created by @lucasoliveirabr on GitHub (Aug 14, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3998 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Create a backend project with Cloudflare Workers and Hono and try to run it without Workers support for Node.js. Update from the previous issue: Now the project runs and keep on, but when I make any kind of call to my API (Better Auth routes and other routes), it throws this error: Console: X [ERROR] ReferenceError: process is not defined ### Current vs. Expected behavior Until v1.3.4, Better Auth worked normally with non-node.js environments. Now with v1.3.5 (v.1.3.6 and v.1.3.7-beta.1) with the addition of built-in node.js modules to make telemetry work, it's not possible to run it unless adding node.js support to the environment, which isn't possible or desirable in some cases. ### What version of Better Auth are you using? v.1.3.7-beta.1 ### System info ```bash OS: Windows Framework: Hono Environment: Cloudflare Workers ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript ``` ### Additional context Same issue from [3945](https://github.com/better-auth/better-auth/issues/3945) and [3973](https://github.com/better-auth/better-auth/issues/3973) that were closed.
GiteaMirror added the locked label 2026-04-17 17:56:09 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 14, 2025):

This is a known issue caused by the telemetry feature introduced in v1.3.5, which relies on Node.js built-ins like process, os, and path. This breaks compatibility with environments like Cloudflare Workers that don't provide these globals. Disabling telemetry via config or environment variable (telemetry: { enabled: false } or BETTER_AUTH_TELEMETRY=0) may not fully prevent the error, since some Node.js modules are still imported unconditionally in v1.3.7-beta.1 and earlier [source].

A fix was merged recently (PR #3942) that updates telemetry to use dynamic imports and adds better environment checks, but this fix is not included in v1.3.7-beta.1 or any earlier release [source]. Until a new version is released with this fix, the only reliable workarounds are to downgrade to v1.3.4 or patch the code to guard all Node.js imports.

If you need to keep using v1.3.7-beta.1 or later, you can try disabling telemetry as described above, but this may not be sufficient in all environments. Watch for the next release after v1.3.7-beta.1, which should include the compatibility fix.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3188324726 --> @dosubot[bot] commented on GitHub (Aug 14, 2025): <!-- Answer --> This is a known issue caused by the telemetry feature introduced in v1.3.5, which relies on Node.js built-ins like `process`, `os`, and `path`. This breaks compatibility with environments like Cloudflare Workers that don't provide these globals. Disabling telemetry via config or environment variable (`telemetry: { enabled: false }` or `BETTER_AUTH_TELEMETRY=0`) may not fully prevent the error, since some Node.js modules are still imported unconditionally in v1.3.7-beta.1 and earlier [[source](https://github.com/better-auth/better-auth/issues/3973)]. A fix was merged recently (PR #3942) that updates telemetry to use dynamic imports and adds better environment checks, but this fix is not included in v1.3.7-beta.1 or any earlier release [[source](https://github.com/better-auth/better-auth/pull/3942)]. Until a new version is released with this fix, the only reliable workarounds are to downgrade to v1.3.4 or patch the code to guard all Node.js imports. If you need to keep using v1.3.7-beta.1 or later, you can try disabling telemetry as described above, but this may not be sufficient in all environments. Watch for the next release after v1.3.7-beta.1, which should include the compatibility fix. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/87b2047d-b86c-42a4-8cd9-47c5cb11a8e4?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3998)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27115