Closed salvinoto closed 1 year ago
yeah im having the same issue but i cant seem to find out how to fix it. i tried to deploy the starter from vercel but didnt work so i ran the sql migration in the sql editor, and downloaded the types file after. not totally sure what to do here
yeah im having the same issue but i cant seem to find out how to fix it. i tried to deploy the starter from vercel but didnt work so i ran the sql migration in the sql editor, and downloaded the types file after. not totally sure what to do here
As a temporary work around, I got the types from this project and merged them together with my current types. I managed to make it work.
I also had this issue, and fixed it with the following code: https://github.com/vercel/nextjs-subscription-payments/compare/main...JOsacky:nextjs-subscription-payments:main
I am new to typescript so I'm not sure this is a proper solution but it fixes the compilation issue when running npm run build
both locally and in production
This fixed it for me-
supabase start
supabase gen types typescript --local > lib/database.types.ts
This fixed it for me-
Installed the supabase CLI
supabase start
supabase gen types typescript --local > lib/database.types.ts
I haven’t tried it yet, but I assume it might be different do get the types from the CLI? Because I get types using the npx command currently.
Hi, im trying to update my project to use the app dir and Im getting this type issue. Does this mean whatever is on my database needs to be updated? I originally used the stripe supabase subscriptions template to setup my db tables. If so, could anyone share what columns I should have to resolve this? Thanks in advance.
EDIT: So I went through the database types and noticed a difference where the types on this project has foreign key relations and bunch of other stuff missing from mine. I did update my types to the latest using the supabase cli. Is it that the supabase stripe template is outdated?
Type '{ cancel_at: string | null; cancel_at_period_end: boolean | null; canceled_at: string | null; created: string; current_period_end: string; current_period_start: string; ended_at: string | null; ... 8 more ...; prices: { ...; }[]; }' is not assignable to type 'SubscriptionWithProduct'. Types of property 'prices' are incompatible. Type '{ active: boolean | null; currency: string | null; description: string | null; id: string; interval: "day" | "week" | "month" | "year" | null; interval_count: number | null; metadata: Json; ... 4 more ...; products: { ...; }[]; }[]' is missing the following properties from type 'PriceWithProduct': products, active, currency, description, and 8 more.ts(2322) pricing.tsx(32, 3): The expected type comes from property 'subscription' which is declared here on type 'IntrinsicAttributes & Props'