Trader Launchpad
Explore posts from serversThoughts on how to integrate t3 app, connectkit web3 auth, nextjs middleware, and trpc
The matcher is stock from nextjs documentation, and it runs on every route including /api and trpc calls. When I have this middleware enabled I am getting an error on the front page of t3 app, on the standard post.hello trpc call:
When I disable the middleware, this issue goes away. I believe it is due to my nextjs middleware matcher running on every request, and blocking /siwe as a publicpath if they ARE authenticated, sending them to / and something is getitng lost on the trpc side. To clarify on a page reload the middleware is hit multiple times, once on "/", once on "/siwe" which is triggered every page reload by the ClientProvider. The error only happens on the call that originated from "/siwe"
Strangely if I simply move /siwe to /api/siwe, the error goes away. Also if I remove the logic the error goes away.
What is the correct way to setup the nextjs middleware in this situation? Should I just add /siwe as an ignored route in the middleware matcher? Should i be putting my /siwe logic in trpc routes and calling it that way (api.user.getNonce, api.user.verifyNonce. api.user.createSession, ect)?
4 replies
[How To?] Create a record in database on form submission...
removed the uuid database column and all works as expected. Its some error im my implementation of uuids in sqlite, not a trpc issue.
if anyone has a method for storing uuids in a cloudflare d1 database, sqlite, let me know
5 replies
[How To?] Create a record in database on form submission...
Actually, looking now i can see an error:
on the trpc call.
I have a uuid field I created that is supposed to work with sqlite. Ill remove it and try to insert a record just using basic id and report back. If anyone has an implementation of binary uuids in sqlite id love to see it.
5 replies
[How To] Properly use trpc UseQuery based on currently selected item
as an update I added:
to the top of my coursecomponent file and it seems to have fixed the error
Reference: https://github.com/prisma/studio/issues/614#issuecomment-1186637811
55 replies
[How To] Properly use trpc UseQuery based on currently selected item
hmmm...ill look into making sure superjson is set up peoperly then, but its using the default setup for packages/api from t3-turbo:
I have "superjson": "^1.9.1", in package.json
its added to packages/api/src/trpc.ts
55 replies
[How To] Properly use trpc UseQuery based on currently selected item
if i change lessonRouter to:
so number rather than bigint, and then change the videoUri query with a hardcoded number I can get the proper videoUri in a console.log on the screen
55 replies