[GH-ISSUE #5111] Release 1.3.25 Breaking Changes #10165

Closed
opened 2026-04-13 06:07:36 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @l0gicgate on GitHub (Oct 6, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5111

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Test suite with Jest started failing after updating to 1.3.25:

  ● Test suite failed to run

    TypeError: A dynamic import callback was invoked without --experimental-vm-modules

      at createTelemetry (node_modules/better-auth/dist/shared/better-auth.Cn-kIXzo.cjs:34:5)
      at init (node_modules/better-auth/dist/shared/better-auth.Cn-kIXzo.cjs:97:29)

This PR is what broke things:
https://github.com/better-auth/better-auth/pull/5007

Current vs. Expected behavior

It should not break.

Reverting to 1.3.24 everything works fine.

What version of Better Auth are you using?

1.3.26

System info

Nothing comes out of that command. It's broken.

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

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  telemetry: { enabled: false },
});

Additional context

No response

Originally created by @l0gicgate on GitHub (Oct 6, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5111 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Test suite with Jest started failing after updating to 1.3.25: ``` ● Test suite failed to run TypeError: A dynamic import callback was invoked without --experimental-vm-modules at createTelemetry (node_modules/better-auth/dist/shared/better-auth.Cn-kIXzo.cjs:34:5) at init (node_modules/better-auth/dist/shared/better-auth.Cn-kIXzo.cjs:97:29) ``` This PR is what broke things: https://github.com/better-auth/better-auth/pull/5007 ### Current vs. Expected behavior It should not break. Reverting to 1.3.24 everything works fine. ### What version of Better Auth are you using? 1.3.26 ### System info ```bash Nothing comes out of that command. It's broken. ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ telemetry: { enabled: false }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 06:07:37 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 6, 2025):

This is a known breaking change in Better Auth ≥1.3.25. The library now uses a dynamic import for telemetry during initialization, regardless of whether telemetry is enabled or disabled in your config. Disabling telemetry only stops events from being sent—it does not prevent the dynamic import itself. Jest (in CommonJS mode) does not support dynamic import without the --experimental-vm-modules flag, which causes the error you’re seeing see code analysis.

Workarounds:

  • Run Jest with Node’s --experimental-vm-modules flag.
  • Switch Jest to ESM mode (see example config).
  • Downgrade to Better Auth 1.3.24 or earlier.

This issue is tracked in several threads and is a side effect of the PR that improved bundle size and startup time by lazy-loading telemetry, but it unintentionally broke Jest and some non-Node environments see discussion.

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:3369608926 --> @dosubot[bot] commented on GitHub (Oct 6, 2025): <!-- Answer --> This is a known breaking change in Better Auth ≥1.3.25. The library now uses a dynamic import for telemetry during initialization, regardless of whether telemetry is enabled or disabled in your config. Disabling telemetry only stops events from being sent—it does not prevent the dynamic import itself. Jest (in CommonJS mode) does not support dynamic import without the --experimental-vm-modules flag, which causes the error you’re seeing [see code analysis](https://github.com/better-auth/better-auth/blob/ad59590e2491359a2787d75b3209b02351ff99de/packages/better-auth/src/init.ts). Workarounds: - Run Jest with Node’s --experimental-vm-modules flag. - Switch Jest to ESM mode (see [example config](https://github.com/better-auth/better-auth/issues/4531)). - Downgrade to Better Auth 1.3.24 or earlier. This issue is tracked in several threads and is a side effect of the PR that improved bundle size and startup time by lazy-loading telemetry, but it unintentionally broke Jest and some non-Node environments [see discussion](https://github.com/better-auth/better-auth/issues/3973). <!-- 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/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4ef15db5-dc6d-4246-bb5a-2447553d01ae?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/5111)
Author
Owner

@jonaspm commented on GitHub (Oct 6, 2025):

I hit the same issue, the breaking change does not work in Cloudflare Workers, had to rollback to v1.3.24

<!-- gh-comment-id:3374243003 --> @jonaspm commented on GitHub (Oct 6, 2025): I hit the same issue, the breaking change does not work in Cloudflare Workers, had to rollback to v1.3.24
Author
Owner

@himself65 commented on GitHub (Oct 8, 2025):

We have removed the dynamic import in 1.3.27.

e704398a25
721326c3b3

<!-- gh-comment-id:3382481614 --> @himself65 commented on GitHub (Oct 8, 2025): We have removed the dynamic import in 1.3.27. https://github.com/better-auth/better-auth/commit/e704398a250b76bf781d8f4232b6b63c19b375b4 https://github.com/better-auth/better-auth/commit/721326c3b3d3ab919564141ea862e1231c411278
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10165