-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createContext is not a function for NextJS middleware #87
Labels
Comments
iKonrad
changed the title
createContext is not a function for NextJS 15 middleware
createContext is not a function for NextJS middleware
Sep 27, 2024
We're currently prioritizing support for the stable versions of Next + React (as opposed to working with release candidates). Until we prioritize support with the newer versions, Convex Auth will work best with the stable versions of react + next. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to integrate Convex auth with NextJS. I'm following the following docs:
https://labs.convex.dev/auth/authz/nextjs
It requires setting up a middleware using convexAuthNextjsMiddleware - but whenever I try to use it, I get the following error:
I digged a bit and it seems that the @convex-dev/auth/nextjs/server/index.js (which is server-only file) is importing nextjs/client.js which is client-only and imports React hooks, which most likely is triggering the error.
I wonder how is that supposed to work? Did I miss something? I don't understand why the middleware was bundled together with context provider in a single file.
From my perspective, obvious solution would be to decouple context provider from middleware, but maybe there was a reason for this?
My deps:
The text was updated successfully, but these errors were encountered: