David
David
Explore posts from servers
BABetter Auth
Created by David on 3/7/2025 in #help
Error fetching subscription from Stripe
I have this code
const checkout = async () => {
const { data, error } = await client.subscription.upgrade({
plan: 'pro',
successUrl: '/settings/billing',
cancelUrl: '/settings/billing'
})
}
const checkout = async () => {
const { data, error } = await client.subscription.upgrade({
plan: 'pro',
successUrl: '/settings/billing',
cancelUrl: '/settings/billing'
})
}
that generates this error :
ERROR [Better Auth]: Error fetching subscription from Stripe
Invalid prisma.subscription.update() invocation:

{
where: {
referenceId: "k8OMNp7UCEKPycrv5lvvrgBi7Wgdix7P",
? id?: String,
? AND?: SubscriptionWhereInput | SubscriptionWhereInput[],
? OR?: SubscriptionWhereInput[],
? NOT?: SubscriptionWhereInput | SubscriptionWhereInput[],
? plan?: StringFilter | String,
? stripeCustomerId?: StringNullableFilter | String | Null,
? stripeSubscriptionId?: StringNullableFilter | String | Null,
? status?: StringNullableFilter | String | Null,
? periodStart?: DateTimeNullableFilter | DateTime | Null,
? periodEnd?: DateTimeNullableFilter | DateTime | Null,
? cancelAtPeriodEnd?: BoolNullableFilter | Boolean | Null,
? seats?: IntNullableFilter | Int | Null
},
data: {
plan: "pro",
stripeSubscriptionId: "sub_1234",
status: "active",
periodStart: new Date("2025-03-07T13:51:40.000Z"),
periodEnd: new Date("2025-04-07T13:51:40.000Z"),
seats: 1
}
}

Argument where of type SubscriptionWhereUniqueInput needs at least one of id arguments. Available options are marked with ?.
ERROR [Better Auth]: Error fetching subscription from Stripe
Invalid prisma.subscription.update() invocation:

{
where: {
referenceId: "k8OMNp7UCEKPycrv5lvvrgBi7Wgdix7P",
? id?: String,
? AND?: SubscriptionWhereInput | SubscriptionWhereInput[],
? OR?: SubscriptionWhereInput[],
? NOT?: SubscriptionWhereInput | SubscriptionWhereInput[],
? plan?: StringFilter | String,
? stripeCustomerId?: StringNullableFilter | String | Null,
? stripeSubscriptionId?: StringNullableFilter | String | Null,
? status?: StringNullableFilter | String | Null,
? periodStart?: DateTimeNullableFilter | DateTime | Null,
? periodEnd?: DateTimeNullableFilter | DateTime | Null,
? cancelAtPeriodEnd?: BoolNullableFilter | Boolean | Null,
? seats?: IntNullableFilter | Int | Null
},
data: {
plan: "pro",
stripeSubscriptionId: "sub_1234",
status: "active",
periodStart: new Date("2025-03-07T13:51:40.000Z"),
periodEnd: new Date("2025-04-07T13:51:40.000Z"),
seats: 1
}
}

Argument where of type SubscriptionWhereUniqueInput needs at least one of id arguments. Available options are marked with ?.
7 replies
BABetter Auth
Created by David on 3/7/2025 in #help
Stripe subscription update error
I'm working on a nuxt project with better-auth and stripe plugin. I have this code :
const checkout = async () => {
const { data, error } = await client.subscription.upgrade({
plan: 'pro',
successUrl: '/settings/billing',
cancelUrl: '/settings/billing'
})

console.log('data', data)
console.log('error', error)
}
const checkout = async () => {
const { data, error } = await client.subscription.upgrade({
plan: 'pro',
successUrl: '/settings/billing',
cancelUrl: '/settings/billing'
})

console.log('data', data)
console.log('error', error)
}
It redirect me on the stripe checkout page but I when I proceed I recieve this error :
Argument periodStart: Invalid value provided. Expected DateTime, NullableDateTimeFieldUpdateOperationsInput or Null, provided Int.

Invalid prisma.subscription.update() invocation:

{
where: {
referenceId: "1234"
},
data: {
plan: "pro",
stripeSubscriptionId: "sub_1234",
status: "active",
periodStart: 1741337914,
~~~~~~~~~~
periodEnd: 1744016314,
seats: 1
}
}
Argument periodStart: Invalid value provided. Expected DateTime, NullableDateTimeFieldUpdateOperationsInput or Null, provided Int.

Invalid prisma.subscription.update() invocation:

{
where: {
referenceId: "1234"
},
data: {
plan: "pro",
stripeSubscriptionId: "sub_1234",
status: "active",
periodStart: 1741337914,
~~~~~~~~~~
periodEnd: 1744016314,
seats: 1
}
}
31 replies
BABetter Auth
Created by David on 3/6/2025 in #help
Polar Checkout not working
No description
4 replies
BABetter Auth
Created by David on 3/5/2025 in #help
Unlink account doesn't work with allowDifferentEmails enabled
I'm working on a project and I have this auth config :
export const auth = betterAuth({
baseURL: process.env.BETTER_AUTH_URL!,
database: prismaAdapter(prisma, { provider: 'postgresql' }),
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!
}
},
user: {
deleteUser: { enabled: true }
},
account: {
accountLinking: { enabled: true, allowDifferentEmails: true }
}
})
export const auth = betterAuth({
baseURL: process.env.BETTER_AUTH_URL!,
database: prismaAdapter(prisma, { provider: 'postgresql' }),
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!
}
},
user: {
deleteUser: { enabled: true }
},
account: {
accountLinking: { enabled: true, allowDifferentEmails: true }
}
})
And this button :
<UiButton
variant="link"
@click="client.unlinkAccount({ providerId: 'github' })"
class="ml-auto"
>
Supprimer
</UiButton>
<UiButton
variant="link"
@click="client.unlinkAccount({ providerId: 'github' })"
class="ml-auto"
>
Supprimer
</UiButton>
The request succeed but when I reload the page the client.listAccounts() return the "unlinked" account
2 replies
BABetter Auth
Created by David on 3/3/2025 in #help
Stripe integration with nuxt error
I'm currently working with nuxt. Here is a part of my better auth client instance :
import { createAuthClient } from 'better-auth/vue'
import { stripeClient } from '@better-auth/stripe/client'

const client = createAuthClient({
baseURL: url.origin,
fetchOptions: { headers },
plugins: [
stripeClient({ subscription: true })
]
})
import { createAuthClient } from 'better-auth/vue'
import { stripeClient } from '@better-auth/stripe/client'

const client = createAuthClient({
baseURL: url.origin,
fetchOptions: { headers },
plugins: [
stripeClient({ subscription: true })
]
})
And I have this error on the line 8 :
Type '{ id: "stripe-client"; $InferServerPlugin: { id: "stripe"; endpoints: { stripeWebhook: { <C extends [({ body?: undefined; method?: "POST" | undefined; query?: Record<string, any> | undefined; params?: Record<string, any> | undefined; request?: Request | undefined; headers?: HeadersInit | undefined; asResponse?: bool...' is not assignable to type 'BetterAuthClientPlugin'.
The types of '$InferServerPlugin.init' are incompatible between these types.
Type '(ctx: AuthContext) => { options: { databaseHooks: { user: { create: { after(user: { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | ... 1 more ... | undefined; }, ctx: GenericEndpointContext | undefined): Promise<...>; }; }; }; }; }' is not assignable to type '(ctx: AuthContext) => void | { context?: { baseURL?: string | undefined; appName?: string | undefined; secret?: string | undefined; secondaryStorage?: { get?: ((key: string) => string | ... 1 more ... | null) | undefined; set?: ((key: string, value: string, ttl?: number | undefined) => void | Promise<...>) | undefin...'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type '{ id: "stripe-client"; $InferServerPlugin: { id: "stripe"; endpoints: { stripeWebhook: { <C extends [({ body?: undefined; method?: "POST" | undefined; query?: Record<string, any> | undefined; params?: Record<string, any> | undefined; request?: Request | undefined; headers?: HeadersInit | undefined; asResponse?: bool...' is not assignable to type 'BetterAuthClientPlugin'.
The types of '$InferServerPlugin.init' are incompatible between these types.
Type '(ctx: AuthContext) => { options: { databaseHooks: { user: { create: { after(user: { id: string; name: string; email: string; emailVerified: boolean; createdAt: Date; updatedAt: Date; image?: string | ... 1 more ... | undefined; }, ctx: GenericEndpointContext | undefined): Promise<...>; }; }; }; }; }' is not assignable to type '(ctx: AuthContext) => void | { context?: { baseURL?: string | undefined; appName?: string | undefined; secret?: string | undefined; secondaryStorage?: { get?: ((key: string) => string | ... 1 more ... | null) | undefined; set?: ((key: string, value: string, ttl?: number | undefined) => void | Promise<...>) | undefin...'.
Types of parameters 'ctx' and 'ctx' are incompatible.
And I don't have the subscription property on client.
2 replies
NNuxt
Created by David on 2/1/2025 in #❓・help
Two component files resolving to the same name `UiLabel`
Hello, I'm creating a web application and when I try to make a component in the folder app/components/ui/label/index.ts and app/components/ui/label/Label.vue like shadcn-vue does I have this error :
WARN Two component files resolving to the same name UiLabel:
nuxt 07:08:35

- <path>/<project>/app/components/ui/label/index.ts
- <path>/<project>/app/components/ui/label/Label.vue
WARN Two component files resolving to the same name UiLabel:
nuxt 07:08:35

- <path>/<project>/app/components/ui/label/index.ts
- <path>/<project>/app/components/ui/label/Label.vue
18 replies
NNuxt
Created by David on 1/20/2025 in #❓・help
Could not load @nuxtjs/sitemap. Is it installed?
I have started a new fresh project, install @nuxtjs/sitemap add it to nuxt.config.ts modules and then, when I start my application I have this error.
ERROR Cannot start nuxt: Could not load @nuxtjs/sitemap. Is it installed?
ERROR Cannot start nuxt: Could not load @nuxtjs/sitemap. Is it installed?
9 replies
BABetter Auth
Created by David on 1/9/2025 in #help
Nuxt SSR useActiveOrganization
Hello! How to use useActiveOrganization with nuxt ssr. I tried this :
const { data: activeOrganization } = client.useActiveOrganization()
const { data: activeOrganization } = client.useActiveOrganization()
like in the doc but when I display it with:
console.log(activeOrganization)
console.log(activeOrganization)
It is undefined
2 replies
BABetter Auth
Created by David on 1/9/2025 in #help
Impossible to call the expression useListOrganizations
Hello guys! Today I'm working on a project in nuxt with an auth powered by better-auth. I need organization plugin and it works well. But there is a type issue. I have the error :
Impossible to call this expression.
The ‘Readonly<Ref<any, any>>’ type has no call signature.
Impossible to call this expression.
The ‘Readonly<Ref<any, any>>’ type has no call signature.
With this code :
client.useListOrganizations()
client.useListOrganizations()
2 replies
NNuxt
Created by David on 11/3/2024 in #❓・help
Nuxt Studio doesn't detect my project on GitHub
Hello, I want to use nuxt studio for my nuxt content project but it isn't detected. I have already install Nuxt Studio app inside my organisation and make it access to all repos but it doesn't work 😢
4 replies
NNuxt
Created by David on 11/3/2024 in #❓・help
Calling `useRoute` within middleware may lead to misleading results
Hello I'm creating a documention with nuxt content and I'm using the following middleware :
export default defineNuxtRouteMiddleware(async (to) => {})
export default defineNuxtRouteMiddleware(async (to) => {})
So, an empty middleware, it throw the following warning :
[nuxt] Calling `useRoute` within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.
[nuxt] Calling `useRoute` within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.
5 replies
NNuxt
Created by David on 10/29/2024 in #❓・help
Is it possible to insert a component just under the body element of a web page in Nuxt
?
5 replies
NNuxt
Created by David on 10/27/2024 in #❓・help
How do we use nuxt/fonts with local otf files ?
Hi guys! I have to use local font files in my nuxt project. I tried to make an configuration like this :
export default defineNuxtConfig({
...
modules: [..., '@nuxt/fonts'],
fonts: {
local: {},
defaults: {
weights: [400, 500, 600, 700, 800],
styles: ['normal', 'italic']
}
}
})
export default defineNuxtConfig({
...
modules: [..., '@nuxt/fonts'],
fonts: {
local: {},
defaults: {
weights: [400, 500, 600, 700, 800],
styles: ['normal', 'italic']
}
}
})
I have move all my necessary font files in /public/_fonts directory, but when I apply font on my element it doesn't work: /public/_fonts/My Font.otf font-family: 'My Font'
6 replies
NNuxt
Created by David on 6/9/2024 in #❓・help
UseRoute within middleware (nuxt content)
Hello everyone, I have this warning when I return to the home (/)
[nuxt] Calling `useRoute` within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.
[nuxt] Calling `useRoute` within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.
6 replies
NNuxt
Created by David on 6/4/2024 in #❓・help
[Content Module]: Infinite page loading when using ProseUl with documentDriven set to true
Environment - Operating System: Windows_NT - Node Version: v20.10.0 - Nuxt Version: 3.11.2 - CLI Version: 3.11.1 - Nitro Version: 2.9.6 - Package Manager: [email protected] - Builder: - - User Config: css, devtools, modules, content, fonts - Runtime Modules: @nuxt/[email protected], @nuxtjs/[email protected], @nuxt/[email protected], [email protected] - Build Modules: - Reproduction https://stackblitz.com/edit/github-pckqev Describe the bug Infinite page loading when using own ProseUl component with documentDriven set to true
7 replies
NNuxt
Created by David on 4/10/2024 in #❓・help
Tailwind dynamic color class doesn't work
No description
2 replies
NNuxt
Created by David on 4/3/2024 in #❓・help
[Vue warn]: Component inside <Transition> renders non-element root node that cannot be animated.
Hello everyone ! I've tried to make a combobox with an appear animation of the popper but I have the error:
[Vue warn]: Component inside <Transition> renders non-element root node that cannot be animated.
at <Teleport disabled=false forceMount=true to=undefined >
at <ComboboxPortal forceMount="" >
at <BaseTransition appear=false persisted=false mode=undefined ... >
at <Transition name="fade" >
at <Primitive ref=fn<s> style=
Object { pointerEvents: undefined }
as=undefined ... >
at <PopperRoot class="w-[200px]" >
at <ComboboxRoot modelValue="" onUpdate:modelValue=fn class="w-[200px]" >
at <Combobox modelValue="" onUpdate:modelValue=fn options=
Array(3) [ "Option 1", "Option 2", "Option 3" ]
... >
at <App key=3 >
at <NuxtRoot>
[Vue warn]: Component inside <Transition> renders non-element root node that cannot be animated.
at <Teleport disabled=false forceMount=true to=undefined >
at <ComboboxPortal forceMount="" >
at <BaseTransition appear=false persisted=false mode=undefined ... >
at <Transition name="fade" >
at <Primitive ref=fn<s> style=
Object { pointerEvents: undefined }
as=undefined ... >
at <PopperRoot class="w-[200px]" >
at <ComboboxRoot modelValue="" onUpdate:modelValue=fn class="w-[200px]" >
at <Combobox modelValue="" onUpdate:modelValue=fn options=
Array(3) [ "Option 1", "Option 2", "Option 3" ]
... >
at <App key=3 >
at <NuxtRoot>
Here is the layout of my component :
<ComboboxRoot>
<ComboboxAnchor>
<ComboboxTrigger>
...
</ComboboxTrigger>
</ComboboxAnchor>

<Transition name="fade">
<ComboboxPortal forceMount>
<ComboboxContent position="popper">
<ComboboxViewport>
<div>
<ComboboxInput />
</div>
<ComboboxGroup>
<ComboboxItem>
<span>...</span>
<ComboboxItemIndicator>
</ComboboxItemIndicator>
</ComboboxItem>
</ComboboxGroup>

<ComboboxEmpty />
</ComboboxViewport>
</ComboboxContent>
</ComboboxPortal>
</Transition>
</ComboboxRoot>
<ComboboxRoot>
<ComboboxAnchor>
<ComboboxTrigger>
...
</ComboboxTrigger>
</ComboboxAnchor>

<Transition name="fade">
<ComboboxPortal forceMount>
<ComboboxContent position="popper">
<ComboboxViewport>
<div>
<ComboboxInput />
</div>
<ComboboxGroup>
<ComboboxItem>
<span>...</span>
<ComboboxItemIndicator>
</ComboboxItemIndicator>
</ComboboxItem>
</ComboboxGroup>

<ComboboxEmpty />
</ComboboxViewport>
</ComboboxContent>
</ComboboxPortal>
</Transition>
</ComboboxRoot>
14 replies