[GH-ISSUE #246] Cannot find module better-auth/node or its corresponding type declarations #25509

Closed
opened 2026-04-17 15:46:08 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @BayBreezy on GitHub (Oct 19, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/246

Describe the bug
The toNodeHandler does not work.
I get this error when i try to test it out in express

Cannot find module 'better-auth/node' or its corresponding type declarations

I tried importing from better-auth/dist/node and got another error

Package subpath './dist/node' is not defined by "exports" in /Users/baker/Desktop/node-better-auth-test/node_modules/better-auth/package.json

To Reproduce
Steps to reproduce the behavior:

  1. Generate a simple express app
  2. Follow the installation steps in the docs
  3. Follow the node integration setup from docs
  4. Run the express app
  5. See error

Expected behavior
For the toNodeHandler to exist and the path better-auth/node to export it properly.

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOs
  • Browser: N/A (didn't get to try it out)
  • Version [e.g. 22]

Smartphone (please complete the following information):
N/A

Additional context
N/A

Originally created by @BayBreezy on GitHub (Oct 19, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/246 **Describe the bug** The `toNodeHandler` does not work. I get this error when i try to test it out in express ``` Cannot find module 'better-auth/node' or its corresponding type declarations ``` I tried importing from `better-auth/dist/node` and got another error ``` Package subpath './dist/node' is not defined by "exports" in /Users/baker/Desktop/node-better-auth-test/node_modules/better-auth/package.json ``` **To Reproduce** Steps to reproduce the behavior: 1. Generate a simple express app 2. Follow the installation steps in the docs 3. Follow the node integration setup from docs 4. Run the express app 5. See error **Expected behavior** For the `toNodeHandler` to exist and the path `better-auth/node` to export it properly. **Screenshots** <img width="1083" alt="image" src="https://github.com/user-attachments/assets/f93fe07d-75f5-41ef-8c20-f2cbed65dc73"> **Desktop (please complete the following information):** - OS: MacOs - Browser: N/A (didn't get to try it out) - Version [e.g. 22] **Smartphone (please complete the following information):** N/A **Additional context** N/A
GiteaMirror added the locked label 2026-04-17 15:46:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25509