-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add server side rendering (SSR) support #99
Comments
I have the Auth login widget on a page in my /app folder on NextJS 13 and I'm getting hydration issues. The page is set to 'client only'; to use client rendering but what happens is the login box loads totally without styles, then figures itself out. |
Same problem when using the Auth component with next.js client side. It will load without styles 1st then eventually load the styles in |
1+ |
I'm getting the same issue running Next 13.4.2 the styles load after a split second but causes a flicker when the styles change @silentworks is there a recommended workaround to fix this at the moment or just implement a simple timeout to wait a bit before displaying the component? |
bump |
How did you guys get this package working with SSR at all? I keep running into a webpack type error that suggests the package is using React's createContext and useContext hooks, which are not typically compatible with server-side rendering (SSR). |
Use this repo: https://github.com/mryechkin/nextjs-supabase-auth |
Thanks; that doesn't use the AuthUI package though. |
I am using remix (tried both with vite and remix compiler), just followed the guide in the docs and it works |
Cool. These docs? https://supabase.com/docs/guides/auth/auth-helpers/remix?language=ts Maybe useOutletContext is the key. This is from '@remix-run/node'; I'm gonna guess it won't work with NextJS. I wonder if Next has something similar. |
Those docs are for the auth itself not the ui, here is the ui: https://supabase.com/docs/guides/auth/auth-helpers/auth-ui Only the supabase client I get from the one I initialize in root through outletContext (don't create a new one) explained in the docs you mentioned: https://supabase.com/docs/guides/auth/auth-helpers/remix?language=ts |
ndaidong, thanks, interesting. If I understand correctly what this is doing, it's basically just creating a standard React client-side context, which is passed down the tree, causing the AuthUI component to be rendered client-side rather than server-side. I don't think this component is actually being rendered server-side currently. |
using next |
style it yourself and don't rely on the library themes. Here is an example with tailwind https://github.com/Nedi11/supaweb/blob/master/app/routes/signin.tsx |
This repo is not going to be updated: https://github.com/supabase/auth-ui#maintenance-mode |
If helpers very good => very easy to build ui
|
Just a note @Nedi11: Auth helpers are actually not recommended now either: https://supabase.com/docs/guides/auth/auth-helpers |
Add SSR support for the Auth UI so it will render when using a server side rendering framework like NextJS. Currently if this component is used on a SSR page it doesn't load until the client side code has loaded. Stitches allows for SSR in its config.
The text was updated successfully, but these errors were encountered: