Typescript error on deployment

Been trying to get this tutorial to work:- https://supabase.com/docs/guides/with-nextjs Able to deploy on dev but not promote to production on Vercel, which I believe due to a TS error on this block of code:
const { subscription } = supabase.auth.onAuthStateChange(
(_event, session) => {
setSession(session)
}
)
const { subscription } = supabase.auth.onAuthStateChange(
(_event, session) => {
setSession(session)
}
)
with this error, Property 'subscription' does not exist on type '{ data: { subscription: Subscription; }; }'.", This can be found under Launch.js here https://supabase.com/docs/guides/with-nextjs#launch
Quickstart: Next.js | Supabase
Learn how to use Supabase in your Next App.
1 Reply
laznic
laznic3y ago
Should it be const { data: { subscription } } = supabase.auth.onAuthStateChange based on the type error? Or const { data: subscription } = supabase.auth.onAuthStateChange, seen this in other examples

Did you find this page helpful?