[GH-ISSUE #682] Type error when using admin plugin #17009

Closed
opened 2026-04-15 14:57:09 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @jaspreet-singh-96 on GitHub (Nov 28, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/682

Describe the bug
I am getting below error when using admin plugin in NextJS.

To Reproduce
Add admin() in auth config.

Expected behavior
Auth should work without type error.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: MacOS 15
  • Browser: Chromium
  • Version: 131
Originally created by @jaspreet-singh-96 on GitHub (Nov 28, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/682 **Describe the bug** I am getting below error when using admin plugin in NextJS. **To Reproduce** Add admin() in auth config. **Expected behavior** Auth should work without type error. **Screenshots** <img width="909" alt="image" src="https://github.com/user-attachments/assets/509e2cb3-2c6c-4863-9d02-8a2956ca8fda"> <img width="909" alt="image" src="https://github.com/user-attachments/assets/6e9dbdf1-76ce-455a-8eee-bdc1b7f5459d"> **Desktop (please complete the following information):** - OS: MacOS 15 - Browser: Chromium - Version: 131
GiteaMirror added the locked label 2026-04-15 14:57:09 -05:00
Author
Owner

@Bekacru commented on GitHub (Nov 28, 2024):

make sure to set declaration:false in your tsconfig.

https://www.better-auth.com/docs/concepts/typescript#declaration-files

<!-- gh-comment-id:2505715271 --> @Bekacru commented on GitHub (Nov 28, 2024): make sure to set `declaration:false` in your tsconfig. https://www.better-auth.com/docs/concepts/typescript#declaration-files
Author
Owner

@jaspreet-singh-96 commented on GitHub (Nov 28, 2024):

working

<!-- gh-comment-id:2505735276 --> @jaspreet-singh-96 commented on GitHub (Nov 28, 2024): working
Author
Owner

@rhyek commented on GitHub (Dec 7, 2024):

Also not working with exactOptionalPropertyTypes enabled.

<!-- gh-comment-id:2525292950 --> @rhyek commented on GitHub (Dec 7, 2024): Also not working with `exactOptionalPropertyTypes` enabled.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#17009