[GH-ISSUE #6193] [Types]: PrettifyDeep is no longer exposed #10438

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

Originally created by @notaphplover on GitHub (Nov 22, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6193

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install better-auth@1.4.0.
  2. Try importing PrettifyDeep type:
import { PrettifyDeep } from 'better-auth';

Current vs. Expected behavior

I expect the type to be available as it was at better-auth@1.3.34, but it's no longer available.

What version of Better Auth are you using?

1.4.0

System info

{
  "system": {
    "platform": "linux",
    "arch": "x64",
    "version": "#35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 13:55:17 UTC 2",
    "release": "6.14.0-35-generic",
    "cpuCount": 16,
    "cpuModel": "AMD Ryzen 9 4900HS with Radeon Graphics",
    "totalMemory": "38.60 GB",
    "freeMemory": "32.92 GB"
  },
  "node": {
    "version": "v24.11.1",
    "env": "development"
  },
  "packageManager": {
    "name": "pnpm",
    "version": "10.23.0"
  },
  "frameworks": [
    {
      "name": "fastify",
      "version": "5.6.2"
    },
    {
      "name": "hono",
      "version": "4.10.6"
    }
  ],
  "databases": [
    {
      "name": "better-sqlite3",
      "version": "^12.4.6"
    }
  ],
  "betterAuth": {
    "version": "^1.4.0",
    "config": null
  }
}

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

Types

Auth config (if applicable)

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

Additional context

No response

Originally created by @notaphplover on GitHub (Nov 22, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6193 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Install `better-auth@1.4.0`. 2. Try importing PrettifyDeep type: ```ts import { PrettifyDeep } from 'better-auth'; ``` ### Current vs. Expected behavior I expect the type to be available as it was at `better-auth@1.3.34`, but it's no longer available. ### What version of Better Auth are you using? 1.4.0 ### System info ```bash { "system": { "platform": "linux", "arch": "x64", "version": "#35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 13:55:17 UTC 2", "release": "6.14.0-35-generic", "cpuCount": 16, "cpuModel": "AMD Ryzen 9 4900HS with Radeon Graphics", "totalMemory": "38.60 GB", "freeMemory": "32.92 GB" }, "node": { "version": "v24.11.1", "env": "development" }, "packageManager": { "name": "pnpm", "version": "10.23.0" }, "frameworks": [ { "name": "fastify", "version": "5.6.2" }, { "name": "hono", "version": "4.10.6" } ], "databases": [ { "name": "better-sqlite3", "version": "^12.4.6" } ], "betterAuth": { "version": "^1.4.0", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 06:34:30 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 22, 2025):

tag @better-auth-agent if you would like an answer from the Agent

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3566546468 --> @better-auth-agent[bot] commented on GitHub (Nov 22, 2025): tag @better-auth-agent if you would like an answer from the Agent <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@dosubot[bot] commented on GitHub (Nov 22, 2025):

Hi @notaphplover! I'm Dosu and I’m helping the better-auth team.

The PrettifyDeep type is no longer exported in better-auth@1.4.0. This was an intentional change to improve TypeScript compilation performance, as shown in recent PRs (#5893). The type is still defined internally, but it's not exposed from the package's public API, so you can't import it from 'better-auth' anymore (source).

If you need PrettifyDeep, you can copy its definition directly from the source:

export type PrettifyDeep<T> = {
  [K in keyof T]: T[K] extends (...args: any[]) => any
    ? T[K]
    : T[K] extends object
      ? T[K] extends Array<any>
        ? T[K]
        : T[K] extends Date
          ? T[K]
          : PrettifyDeep<T[K]>
      : T[K];
} & {};

Alternatively, refactor your code to use the underlying types directly, as recent updates have removed PrettifyDeep from most internal usage (PR #5009). There is no direct replacement or alternative type provided in 1.4.0.

If you run into type inference issues, explicit type annotations or disabling TypeScript declaration generation can help as a workaround (thread). Keep an eye on future releases or changelogs if you rely on utilities like PrettifyDeep.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

<!-- gh-comment-id:3566551257 --> @dosubot[bot] commented on GitHub (Nov 22, 2025): <!-- Greeting --> Hi @notaphplover! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> The PrettifyDeep type is no longer exported in better-auth@1.4.0. This was an intentional change to improve TypeScript compilation performance, as shown in recent PRs ([#5893](https://github.com/better-auth/better-auth/pull/5893)). The type is still defined internally, but it's not exposed from the package's public API, so you can't import it from 'better-auth' anymore ([source](https://github.com/better-auth/better-auth/blob/44308bf20d431bd943a92a2ed4204a6b7d5a4182/packages/better-auth/src/types/helper.ts)). If you need PrettifyDeep, you can copy its definition directly from the source: ```ts export type PrettifyDeep<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends object ? T[K] extends Array<any> ? T[K] : T[K] extends Date ? T[K] : PrettifyDeep<T[K]> : T[K]; } & {}; ``` Alternatively, refactor your code to use the underlying types directly, as recent updates have removed PrettifyDeep from most internal usage ([PR #5009](https://github.com/better-auth/better-auth/pull/5009)). There is no direct replacement or alternative type provided in 1.4.0. If you run into type inference issues, explicit type annotations or disabling TypeScript declaration generation can help as a workaround ([thread](https://github.com/better-auth/better-auth/issues/5637)). Keep an eye on future releases or changelogs if you rely on utilities like PrettifyDeep. <!-- 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/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a8c643b9-0679-4557-b5e6-aa7a04861258?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20PrettifyDeep%20type%20is%20no%20longer%20exported%20in%20better-auth%401.4.0.%20This%20was%20an%20intentional%20change%20to%20improve%20TypeScript%20compilation%20performance%2C%20as%20shown%20in%20recent%20PRs%20%28%5B%235893%5D%28https%3A//github.com/better-auth/better-auth/pull/5893%29%29.%20The%20type%20is%20still%20defined%20internally%2C%20but%20it%27s%20not%20exposed%20from%20the%20package%27s%20public%20API%2C%20so%20you%20can%27t%20import%20it%20from%20%27better-auth%27%20anymore%20%28%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/blob/44308bf20d431bd943a92a2ed4204a6b7d5a4182/packages/better-auth/src/types/helper.ts%29%29.%0A%0AIf%20you%20need%20PrettifyDeep%2C%20you%20can%20copy%20its%20definition%20directly%20from%20the%20source%3A%0A%0A%60%60%60ts%0Aexport%20type%20PrettifyDeep%3CT%3E%20%3D%20%7B%0A%20%20%5BK%20in%20keyof%20T%5D%3A%20T%5BK%5D%20extends%20%28...args%3A%20any%5B%5D%29%20%3D%3E%20any%0A%20%20%20%20%3F%20T%5BK%5D%0A%20%20%20%20%3A%20T%5BK%5D%20extends%20object%0A%20%20%20%20%20%20%3F%20T%5BK%5D%20extends%20Array%3Cany%3E%0A%20%20%20%20%20%20%20%20%3F%20T%5BK%5D%0A%20%20%20%20%20%20%20%20%3A%20T%5BK%5D%20extends%20Date%0A%20%20%20%20%20%20%20%20%20%20%3F%20T%5BK%5D%0A%20%20%20%20%20%20%20%20%20%20%3A%20PrettifyDeep%3CT%5BK%5D%3E%0A%20%20%20%20%20%20%3A%20T%5BK%5D%3B%0A%7D%20%26%20%7B%7D%3B%0A%60%60%60%0A%0AAlternatively%2C%20refactor%20your%20code%20to%20use%20the%20underlying%20types%20directly%2C%20as%20recent%20updates%20have%20removed%20PrettifyDeep%20from%20most%20internal%20usage%20%28%5BPR%20%235009%5D%28https%3A//github.com/better-auth/better-auth/pull/5009%29%29.%20There%20is%20no%20direct%20replacement%20or%20alternative%20type%20provided%20in%201.4.0.%0A%0AIf%20you%20run%20into%20type%20inference%20issues%2C%20explicit%20type%20annotations%20or%20disabling%20TypeScript%20declaration%20generation%20can%20help%20as%20a%20workaround%20%28%5Bthread%5D%28https%3A//github.com/better-auth/better-auth/issues/5637%29%29.%20Keep%20an%20eye%20on%20future%20releases%20or%20changelogs%20if%20you%20rely%20on%20utilities%20like%20PrettifyDeep.)&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/6193)
Author
Owner

@bytaesu commented on GitHub (Jan 16, 2026):

Hello @notaphplover,

This appears to have been an export that was missing in the 1.4.0 release, and currently it is available 🙏

<!-- gh-comment-id:3761141527 --> @bytaesu commented on GitHub (Jan 16, 2026): Hello @notaphplover, This appears to have been an export that was missing in the 1.4.0 release, and currently it is available 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10438