Property 'stripeCustomerId' does not exist
Version: ^1.3.7-beta.4
I've loaded
better-auth and @better-auth/stripe but keep getting this issue, not sure why...
24 Replies
Can I see ur full auth config?
bit of a mess but:
any ideas here? this mysterious issue is the main type issue left in my migration 😅
Are you working in a monorepo project?
yeah
this has happened since i moved into a monorepo
I've seen something similar where larger auth configs will cause typescript to cut inference after a certain depth of a given type, so when shared across packages in a monorepo you'll see incorrect type inference just because TS has just cut those types off
however better-auth and all places that I consume auth types are all contained within one tanstack start project so not sure
(not sure if it's related)
yeah i saw this with my AI sdk stuff so I had to change to using tsc and project references
but i don’t think that might be the case here, since the better auth types aren’t shared cross package
it specifically seems like the stripe type just isn’t registering
very weird
Okay I see, so your auth is in the same place where your trpc routes are defined?
Yeah
If you were to just make a fake (for testing purposes) new auth instance, and then only include the stripe plugin and pass that to trpc's context thing, see if that will still cause that type issue
hmm, okay
currently am on mobile though
will try this in a few hours and get back to you

ignoring the cursor tab prediction, it doesn't seem to work
looks reproducable in a new project folder

it looks like it started in 1.3.7
?
doesn't seem to happen on 1.3.6
I think this is an internal deps issue
ok no theres more to it
1.3.7-beta.2 works but 1.3.7 doesn'thello there, did you manage to dig this one out?
I'm experiencing a similar issue. Users who log in with Google receive an error when
createCustomerOnSignUp is set to true (which is connected to stripeCustomerId). Downgrading to version 1.3.6 resolved the issue.this missing stripe property issue has been pretty annoying. you can kind of skip the check by manually adding the custom (stripecustomerid) fields to your auth config if you want to use the newer versions.
id really like to see this fixed tho, since the newer versions just started causing it. has a gh issue been created for this yet?
also i've tested receiving the cus id with the type error and it fetched an actual cus id so that's probably a ts issue only
Also the problem still occurs for me even when the instance is just the plugin and basic auth config
It has been fixed now: https://github.com/better-auth/better-auth/pull/4716
GitHub
fix(stripe): onCustomerCreate should be called even if update user ...
Summary by cubic
Guarantees Stripe onCustomerCreate runs after customer creation, even if updateUser returns nothing. The callback now receives the user with stripeCustomerId included.
Bug Fixes
...
the type issue is still occuring unfortunately, tried both in beta and newest version :(
I am still experiencing this issue in v
1.3.27 🤔
is it now necessary to add these fields manually into the user.additionalFields config?