Michael Schaufelberger
Explore posts from serversHydration error when using useQuery instead of useSuspenseQuery when prefetching
Nope, not yet unfortunately. Some findings:
- If I delay the SSR after prefetching significantly (e.g. sleeping right after the prefetch for 4s so the prefetch can complete), the error goes away. This basically means, that if the promise is resolved already, it works.
- If I delay the query's output significantly, so the prefetch cannot be done in time, the error goes away.
- Everything else, is very prone to the hydration mismatch. I.e. it happens close to 100% of the time.
Upgrading to the latest for the trpc and react-query packages did not work. As of now, that is:
Edit: This is the case if I use
query.isFetching
btw. I just need to use this, because I also want to change the table's behavior in case of a refetch. But this shouldn't matter for the initial render afaik.5 replies
Aarktype
•Created by Michael Schaufelberger on 2/7/2025 in #questions
[attest] Getting `requested module ... does not provide an export` error for my bench script
Thank you. Yeah that's the case. Sorry for wasting your time.
Coincidentally, I've never ran any script in this project that had references to an internal monorepo package before. 🤦♂️
For anyone finding this:
Do not forget
"type": "module"
in your workspace package's package.json
and you need to use verbatimModuleSyntax
(in your whole project) for tsx to be able to run everything 😅3 replies
Drizzle pull/push: Permission denied for view pg_stat_user_indexes
Hi cmck
Thanks for looking into it. I've found that drizzle-kit uses the
pg_stat_user_indexes
to find all indexes in the db. https://github.com/drizzle-team/drizzle-orm/blob/e5c63db0df0eaff5cae8321d97a77e5b47c5800d/drizzle-kit/src/serializer/pgSerializer.ts#L1572-L1583
But afaik this runs for all the tables found FROM pg_catalog.pg_class c
if the relkind = 'r'
(https://github.com/drizzle-team/drizzle-orm/blob/e5c63db0df0eaff5cae8321d97a77e5b47c5800d/drizzle-kit/src/serializer/pgSerializer.ts#L985-L1002). Which returns just the public's schema tables when drizzle-kit runs it.
Maybe that helps...9 replies
Drizzle pull/push: Permission denied for view pg_stat_user_indexes
Hi
I'm still experiencing this issue with
test-template2
. It's not high-prio, since I can use drizzle-kit generate for the time being - but I would love to quickly get a "diff" of the schema versions using drizzle.9 replies
Branch copy has old schema version
A quick follow-up question.
You'd have to use a new database and maybe dump and import the schema.What's the simplest way to achieve this so we don't generate too many migrations again? Someone in our team changed the schema too soon, using the ui, making the branch stay in a bad state. So we want to tackle this issue rather sooner than later.
20 replies
pgroll with drizzle generated migrations - possible?
To @Schahin and anyone finding this
I had a similar issue a while ago. I think Xata is actively working on something where you can turn sql files into xata migrations. https://github.com/xataio/pgroll/issues/504
With that you probably will be able to quite easily create pgroll migrations whenever you run drizzle's generate.
4 replies
Branch copy has old schema version
Okay, thanks!
Is there a way to squash the migration history? I think I've read this somewhere in a pgroll issue, but am not sure if it's applicable or even possible.
Can we maybe just create a new dev branch where we create the schema ourselves, e.g. by using DBeaver or Drizzle? Or would this have a similar issue?
20 replies
How do *you* structure the tRPC router when dealing with isolated components?
Thank you for the insight. I think splitting the namespace or even the router is a good idea. So I can better know which procedures are from isolated/deeply nested components.
5 replies
Branch copy has old schema version
Interesting. I've just created
test-template2
and it had the same issues. Then I've tried a completely new name, I'm sure never existed something-new
and both those branches are missing the new columns. It seems that it's not about the target's branch name, but there's an issue reading the base branch.20 replies
Xata Dashboard error when trying to delete a file
To share a little context, we had a lot of difficulty integrating Files with the Native SQL Table, which is why we introduced the toggle so you can flip between the "old" and "new" table.This makes sense. Although, currently, the Native SQL Table is unusable if you have a single file field in the table you want to edit. Editing is basically blocked until you switch the setting. May I make a suggestion to skip/block updating the file fields when having the setting enabled? So we can at least edit the other fields.
17 replies