Skip to content

Conversation

2u841r
Copy link

@2u841r 2u841r commented Aug 17, 2025

otherwise user will get error

✔ 02:17:46 Convex functions ready! (14.41s)
 ○ Compiling /middleware ...
 ⨯ ./middleware.ts:5:1
Module not found: Can't resolve '@better-fetch/fetch'
  3 | import { createAuth } from "./lib/auth";
  4 | import { NextRequest, NextResponse } from "next/server";
> 5 | import { betterFetch } from "@better-fetch/fetch";
    | ^
  6 |
  7 | type Session = ReturnType<typeof createAuth>["$Infer"]["Session"];
  8 | const getSession = async (request: NextRequest) => {

https://nextjs.org/docs/messages/module-not-found
 ✓ Compiled /_error in 916ms (363 modules)
 GET / 404 in 8ms
 ○ Compiling /_not-found ...
 ✓ Compiled /_not-found in 7s (1034 modules)
 GET /_next/static/webpack/0c48476d2883b2b0.webpack.hot-update.json 500 in 25ms
 ⚠ Fast Refresh had to perform a full reload due to a runtime error.
 GET / 404 in 5ms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@2u841r
Copy link
Author

2u841r commented Aug 17, 2025

@erquhart
Copy link
Collaborator

For the example, better fetch is there as a dependency of better auth - did you run npm install both in the repo root and in the example directory?

@2u841r
Copy link
Author

2u841r commented Aug 23, 2025

For the example, better fetch is there as a dependency of better auth - did you run npm install both in the repo root and in the example directory?

Yes, i did both, as in https://github.com/get-convex/better-auth/blob/main/README.md#running-examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants