[GH-ISSUE #7956] @better-auth/core package includes tsconfig.json that extends missing ../../tsconfig.base.json (breaks editor type resolution) #10952

Closed
opened 2026-04-13 07:20:52 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ap-gun on GitHub (Feb 13, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7956

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

@better-auth/core@1.4.18 contains tsconfig.json with:

{
  "extends": "../../tsconfig.base.json"
}

but ../../tsconfig.base.json is not published in the package tree.
This causes editor resolution errors, e.g.:

Cannot read file '.../node_modules/.pnpm/@better-auth+core@1.4.18.../node_modules/
tsconfig.base.json'.ts

Current vs. Expected behavior

Current behavior

  • Type completion/intellisense for Better Auth intermittently fails in editor.
  • Error points to missing tsconfig.base.json under node_modules/.pnpm/.../@better-auth/core.

Expected behavior

  • Published package should not reference non-published internal tsconfig files.
  • Editor type resolution should work without tsconfig read errors.

What version of Better Auth are you using?

1.4.18

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.3.0: Thu Jan  2 20:22:58 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8132",
    "release": "24.3.0",
    "cpuCount": 10,
    "cpuModel": "Apple M4",
    "totalMemory": "32.00 GB",
    "freeMemory": "0.17 GB"
  },
  "node": {
    "version": "v24.13.0",
    "env": "development"
  },
  "packageManager": {
    "name": "pnpm",
    "version": "10.26.2"
  },
  "frameworks": [
    {
      "name": "next",
      "version": "16.1.6"
    },
    {
      "name": "react",
      "version": "19.2.3"
    }
  ],
  "databases": [
    {
      "name": "mysql2",
      "version": "^3.17.0"
    }
  ],
  "betterAuth": {
    "version": "Unknown",
    "config": null,
    "error": "Converting circular structure to JSON\n    --> starting at object with constructor 'Pool'\n    |     property 'config' -> object with constructor 'PoolConfig'\n    |     property 'connectionConfig' -> object with constructor 'ConnectionConfig'\n    --- property 'pool' closes the circle"
  }
}

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

Types

Auth config (if applicable)


Additional context

No response

Originally created by @ap-gun on GitHub (Feb 13, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7956 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce `@better-auth/core@1.4.18` contains `tsconfig.json` with: ```json { "extends": "../../tsconfig.base.json" } ``` but ../../tsconfig.base.json is not published in the package tree. This causes editor resolution errors, e.g.: Cannot read file '.../node_modules/.pnpm/@better-auth+core@1.4.18.../node_modules/ tsconfig.base.json'.ts ### Current vs. Expected behavior ### Current behavior - Type completion/intellisense for Better Auth intermittently fails in editor. - Error points to missing tsconfig.base.json under node_modules/.pnpm/.../@better-auth/core. ### Expected behavior - Published package should not reference non-published internal tsconfig files. - Editor type resolution should work without tsconfig read errors. ### What version of Better Auth are you using? 1.4.18 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.3.0: Thu Jan 2 20:22:58 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8132", "release": "24.3.0", "cpuCount": 10, "cpuModel": "Apple M4", "totalMemory": "32.00 GB", "freeMemory": "0.17 GB" }, "node": { "version": "v24.13.0", "env": "development" }, "packageManager": { "name": "pnpm", "version": "10.26.2" }, "frameworks": [ { "name": "next", "version": "16.1.6" }, { "name": "react", "version": "19.2.3" } ], "databases": [ { "name": "mysql2", "version": "^3.17.0" } ], "betterAuth": { "version": "Unknown", "config": null, "error": "Converting circular structure to JSON\n --> starting at object with constructor 'Pool'\n | property 'config' -> object with constructor 'PoolConfig'\n | property 'connectionConfig' -> object with constructor 'ConnectionConfig'\n --- property 'pool' closes the circle" } } ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 07:20:52 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 13, 2026):

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

This is a known and previously reported issue: the published @better-auth/core package's tsconfig.json extends a tsconfig.base.json that isn't included in the npm package, which causes editor and type resolution errors for consumers. Maintainers have acknowledged the problem and indicated a fix would be released, but as of 1.4.18, the issue persists and the file is still shipped as-is without any automated removal or rewriting of the extends reference during publishing [source 1] [source 2] [source 3].

Referencing non-published config files in a published package is problematic because editors and TypeScript tooling will fail to resolve types, leading to broken intellisense and errors like "Cannot read file .../tsconfig.base.json".

Best practice is for published packages to not reference internal or non-published tsconfig files. The tsconfig.json in a published package should either be omitted or only reference files present in the published package. Workarounds like duplicating the base config in your project or disabling declaration/declarationMap can help, but don't address the root cause [source 2].

This is absolutely suited for GitHub and has already been tracked by maintainers.

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:3895826637 --> @dosubot[bot] commented on GitHub (Feb 13, 2026): <!-- Greeting --> Hi @ap-gun! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This is a known and previously reported issue: the published `@better-auth/core` package's `tsconfig.json` extends a `tsconfig.base.json` that isn't included in the npm package, which causes editor and type resolution errors for consumers. Maintainers have acknowledged the problem and indicated a fix would be released, but as of 1.4.18, the issue persists and the file is still shipped as-is without any automated removal or rewriting of the `extends` reference during publishing [[source 1]](https://github.com/better-auth/better-auth/issues/1856) [[source 2]](https://github.com/better-auth/better-auth/issues/2036) [[source 3]](https://github.com/better-auth/better-auth/blob/0669ed804d8e0ada004c5ba266a6a12be6557cfc/packages/core/tsconfig.json#L1-L7). Referencing non-published config files in a published package is problematic because editors and TypeScript tooling will fail to resolve types, leading to broken intellisense and errors like "Cannot read file .../tsconfig.base.json". Best practice is for published packages to not reference internal or non-published tsconfig files. The `tsconfig.json` in a published package should either be omitted or only reference files present in the published package. Workarounds like duplicating the base config in your project or disabling `declaration`/`declarationMap` can help, but don't address the root cause [[source 2]](https://github.com/better-auth/better-auth/issues/2036). This is absolutely suited for GitHub and has already been tracked by maintainers. <!-- 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/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/76040d85-8bda-4af4-9f29-45d47d592e7c?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=This%20is%20a%20known%20and%20previously%20reported%20issue%3A%20the%20published%20%60%40better-auth/core%60%20package%27s%20%60tsconfig.json%60%20extends%20a%20%60tsconfig.base.json%60%20that%20isn%27t%20included%20in%20the%20npm%20package%2C%20which%20causes%20editor%20and%20type%20resolution%20errors%20for%20consumers.%20Maintainers%20have%20acknowledged%20the%20problem%20and%20indicated%20a%20fix%20would%20be%20released%2C%20but%20as%20of%201.4.18%2C%20the%20issue%20persists%20and%20the%20file%20is%20still%20shipped%20as-is%20without%20any%20automated%20removal%20or%20rewriting%20of%20the%20%60extends%60%20reference%20during%20publishing%20%5B%5Bsource%201%5D%5D%28https%3A//github.com/better-auth/better-auth/issues/1856%29%20%5B%5Bsource%202%5D%5D%28https%3A//github.com/better-auth/better-auth/issues/2036%29%20%5B%5Bsource%203%5D%5D%28https%3A//github.com/better-auth/better-auth/blob/0669ed804d8e0ada004c5ba266a6a12be6557cfc/packages/core/tsconfig.json%23L1-L7%29.%0A%0AReferencing%20non-published%20config%20files%20in%20a%20published%20package%20is%20problematic%20because%20editors%20and%20TypeScript%20tooling%20will%20fail%20to%20resolve%20types%2C%20leading%20to%20broken%20intellisense%20and%20errors%20like%20%22Cannot%20read%20file%20.../tsconfig.base.json%22.%0A%0ABest%20practice%20is%20for%20published%20packages%20to%20not%20reference%20internal%20or%20non-published%20tsconfig%20files.%20The%20%60tsconfig.json%60%20in%20a%20published%20package%20should%20either%20be%20omitted%20or%20only%20reference%20files%20present%20in%20the%20published%20package.%20Workarounds%20like%20duplicating%20the%20base%20config%20in%20your%20project%20or%20disabling%20%60declaration%60/%60declarationMap%60%20can%20help%2C%20but%20don%27t%20address%20the%20root%20cause%20%5B%5Bsource%202%5D%5D%28https%3A//github.com/better-auth/better-auth/issues/2036%29.%0A%0AThis%20is%20absolutely%20suited%20for%20GitHub%20and%20has%20already%20been%20tracked%20by%20maintainers.)&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/7956)
Author
Owner

@ap-gun commented on GitHub (Feb 16, 2026):

Thanks for confirming. I’ll wait for the release that includes the fix.

<!-- gh-comment-id:3905636678 --> @ap-gun commented on GitHub (Feb 16, 2026): Thanks for confirming. I’ll wait for the release that includes the fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10952