TypeError: Cannot read properties of undefined (reading 'value') at withReturning
this is a fun error
with some fun code to match
12 Replies
using planetscale via drizzle
id column is a customType column (dont think it makes a difference)
heres the value of
builderVal[0]
there is no ID column being returned
for refrence, this is how the schema looks
note the mapTo
and mapFrom
functions
this is what drizzle uses to transform the custom data from and to the DB
so far my solution is to do the following:
obviously this only works on one type of auth table
but at lease i can test more nowAre you on the latest version of better auth?
on v1.2.3 @bekacru
We have had similar problem before with mysql + drizzle. It was fixed some versions ago and we have specefic test for mysql :)) But seems like we missed something or there is an issue specifically with planetscale. Will look into it.
epic
db schema is available in https://github.com/un/1up/tree/main/packages/db
GitHub
1up/packages/db at main · un/1up
Open Source Longevity System; Live Longer + Sharper + Better - un/1up
@bekacru did you have a think about this?
or should I just open an issue on GH to track?
Oh yeah I did. I think I pushed some changes, if you haven't tried it on latest do that and let me know if it's still an issue.
ok thanks, will give it a go
still in latest version @bekacru
will keep my patches in place for now
the patch file that works for me
https://github.com/un/1up/blob/main/patches/better-auth.patch
GitHub
1up/patches/better-auth.patch at main · un/1up
Open Source Longevity System; Live Longer + Sharper + Better - un/1up
Just went through the issue. For your use case, you can fix it by actually passing the id generator in your auth config instead
great!
appreciate it