reallist
TTCTheo's Typesafe Cult
•Created by reallist on 2/22/2023 in #questions
tRPC + useSWR for fetching data from Shopify API ?
Thank you!
8 replies
TTCTheo's Typesafe Cult
•Created by reallist on 2/22/2023 in #questions
tRPC + useSWR for fetching data from Shopify API ?
Ah, that's great then, so trpc is even better than I thought 😄
8 replies
TTCTheo's Typesafe Cult
•Created by kewinzaq1 on 1/22/2023 in #questions
Problem with websocket in t3-app
Have you managed to find anything regarding this? I've been experiencing the same issue for the past 10 days and can't pinpoint what is causing this
3 replies
TTCTheo's Typesafe Cult
•Created by reallist on 1/18/2023 in #questions
tRPC Websockets | package subpath not defined by exports
PS > I am using an old version of t3, i.e 6.11.4 so this may perhaps not be an issue which can be reproduced on v7 >
3 replies
TTCTheo's Typesafe Cult
•Created by reallist on 1/18/2023 in #questions
tRPC Websockets | package subpath not defined by exports
Okay, so after many hours of debugging and tests, this appears to be some extremely weird issue which isn't caused by tRPC itself, but rather by tRPC websockets/subscriptions working in combination with the setup of the T3 stack. ( or im just dumb ? not impossible 😄 )
The first error which I showed in the screenshot was actually caused due to the fact that after building, the server.js file in the dist directory was trying to import adapters/ws from "dist/adapters/ws".
Went in the node_modules/@trpc/server/package.json and after examining it it doesn't indeed export any subpath "dist/adapters/ws".
After rebuilding this with and checking the files, it actually started pointing to the correct subpath and the first error got resolved.
This caused another error to start popping up, and that was caused by the env handler created by the T3 package, it was expecting to run with ECMAScript and the files were .mjs files, while the https://github.com/trpc/examples-next-prisma-websockets-starter/blob/main/tsconfig.server.json was actually compiling the project as cjs. After some tweaks to the build files, namely, changing them from mjs to js and fixing the imports/requires inside, I actually managed to run the whole thing.
ofc, that wasn't a permanent solution as no sane person would manually go to edit the build files after every build, so I just ended up removing the env handler thingy because I was too lazy to rework it and it ain't really that much useful for the scope of my project
3 replies