Bart ⚡
Bart ⚡
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Bart ⚡ on 4/23/2023 in #questions
tRPC throwing UNAUTHORIZED after logging in
After I'm logging in using my custom sign-in page (next-auth), I get a redirect to /dashboard. But there, all my tRPC queries are failing and throwing UNAUTHORIZED error. After I simply reload the page everything seems to be working, why is it so? Here's the code: https://github.com/Bartek532/rssmarkable
2 replies
TTCTheo's Typesafe Cult
Created by Bart ⚡ on 4/7/2023 in #questions
T3 Stack + custom Next.js server not working
Hi, I'm using t3 stack and trying to leverage Next.js custom server. But, unfortunately when I'm trying to run it using ts-node I'm constantly getting an error connected to module resolution (I guess it's because my next.config.mjs has .mjs extension):
[1] Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.mjs not supported.
[1] Instead change the require of next.config.mjs to a dynamic import() which is available in all CommonJS modules.
[1] Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.mjs not supported.
[1] Instead change the require of next.config.mjs to a dynamic import() which is available in all CommonJS modules.
What should I do to fix this? Here's the full code: https://github.com/Bartek532/rssmarkable/pull/40 Thanks in advance for all suggestions! 🙂
22 replies
TTCTheo's Typesafe Cult
Created by Bart ⚡ on 3/26/2023 in #questions
Next.js + tRPC + Redis - pub/sub
Hi, I have an app made in Next.js, and I want to get some real-time log feature for it. I thought about using Redis Pub/Sub to do it, and use tRPC Subscriptions also. Ideally I want to publish a message from Next.js API Route and then handle it in tRPC subscription. But for now, I'm trying to make the simplest solution and it doesn't work. I follow docs and made needed things to use it (one diff is I replace event emitter with redis) and when I published my message it doesn't seem to be handled in subscription. Here's the code, I will be glad, if you can take a look and tell me what I'm doing wrong. Thanks in advance! 🙂 https://github.com/Bartek532/rssmarkable/pull/40
4 replies