Missing type definitions export for "better-auth/plugins/access" #753

Closed
opened 2026-03-13 08:02:56 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @lille-morille on GitHub (Feb 28, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Following this step in the documentation, VsCode complains about the following:

Cannot find module 'better-auth/plugins/access' or its corresponding type declarations.
  There are types at '/Users/mori/dev/texicon/monorepo/racetrak/apps/server/node_modules/better-auth/dist/plugins/access.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

Current vs. Expected behavior

The import should work fine, but raises TypeScript compile errors.

What version of Better Auth are you using?

1.1.19

Provide environment information

- OS: MacOS Sequoia with M1 Pro chip

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

Backend, Types

Auth config (if applicable)


Additional context

Following the error message and changing moduleResolution in tsconfig.json to node16 as well as the target does fix the error, but introduces new issues with other imports.

Also, when consol.log-ing the imported function, it does print out that it is a function, so this is merely an issue with the types.

I noticed that no export is defined in the plugins library that points to the access plugin, so that is probably the issue.

Originally created by @lille-morille on GitHub (Feb 28, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Following [this step in the documentation](https://www.better-auth.com/docs/plugins/organization#create-access-control), VsCode complains about the following: ``` Cannot find module 'better-auth/plugins/access' or its corresponding type declarations. There are types at '/Users/mori/dev/texicon/monorepo/racetrak/apps/server/node_modules/better-auth/dist/plugins/access.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. ``` ### Current vs. Expected behavior The import should work fine, but raises TypeScript compile errors. ### What version of Better Auth are you using? 1.1.19 ### Provide environment information ```bash - OS: MacOS Sequoia with M1 Pro chip ``` ### Which area(s) are affected? (Select all that apply) Backend, Types ### Auth config (if applicable) ```typescript ``` ### Additional context Following the error message and changing `moduleResolution` in `tsconfig.json` to `node16` as well as the `target` does fix the error, but introduces new issues with other imports. Also, when `consol.log`-ing the imported function, it does print out that it is a function, so this is merely an issue with the types. I noticed that no export is defined in the [plugins library](https://github.com/better-auth/better-auth/blob/eef60b16bdc238d516572ecd6e3a886f763b9bb3/packages/better-auth/src/plugins/index.ts) that points to the `access` plugin, so that is probably the issue.
GiteaMirror added the bug label 2026-03-13 08:02:56 -05:00
Author
Owner

@andreyselitsky commented on GitHub (Mar 2, 2025):

Fixed by switching in tsconfig.json:

"moduleResolution": "bundler",
@andreyselitsky commented on GitHub (Mar 2, 2025): Fixed by switching in tsconfig.json: ``` "moduleResolution": "bundler", ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#753