BigBellyBigDreams
BigBellyBigDreams
Explore posts from servers
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/21/2023 in #questions
Slow page load times?
No description
6 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
No description
7 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/6/2023 in #questions
useRouter import not working?
just following the docs and trying to add shallow routing. In my app/page.tsx i have the following
"use client";

import { useRouter } from "next/router";

export default function Page() {
const router = useRouter();

...
}
"use client";

import { useRouter } from "next/router";

export default function Page() {
const router = useRouter();

...
}
im getting the following: Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted anyone know why this might be happening?
2 replies
RRailway
Created by BigBellyBigDreams on 10/16/2023 in #✋|help
Faster response times?
So I'm really beginner when it comes to infra and stuff like this so I might not explain things that great. I deployed some services for an app i deployed (mainly just my server and some jobs) and they work good! I saw that these services by default are hosted in the west (im on the east coast) so while response times are fast i feel like they could be better if there was some sort of way I could get it closer. I saw that railway regions was a thing but I just want to see if there were other options before spending more money. Anyone have any tips if you were in my shoes?
32 replies
RRailway
Created by BigBellyBigDreams on 9/27/2023 in #✋|help
Not able to access Postgres from one service but able from the other?
So I'm running into this weird issue. I can access my postgres db with no trouble from one of my services but can't from my other that I have setup as a cron job through railway. Not sure why this is the case. I know it's not a problem with my actual code cause it works fine locally. Any thoughts on why this would be the case?
85 replies
RRailway
Created by BigBellyBigDreams on 9/27/2023 in #✋|help
Configuring Cron Jobs?
So I'm running a cron job I wrote in my app like this
import cron from "node-cron";
import { prisma } from "./connection";

cron.schedule("0 0 * * *", async () => {
console.log("RAN");
await prisma.event.deleteMany();
});
import cron from "node-cron";
import { prisma } from "./connection";

cron.schedule("0 0 * * *", async () => {
console.log("RAN");
await prisma.event.deleteMany();
});
Now I have a seperate service on railway pointing to this one file and running it. I also noticed railway has its own cron scheduler. Do I also have to configure that along with this or is it fine to just leave the service running assuming that the cron job running internally will just run as scheduled?
10 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 7/22/2023 in #questions
Difference between server/client components? When to use?
I kind of just wanted to know when some good practices are when it came to using server/client components. First time using Next and I sometimes see people creating like a seperate api directory or something like that. If there's any resources you know that are helpful that would be awesome
12 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 7/10/2023 in #questions
Prettier TailwindCSS not working with Next?
I just did a fresh create next app and i followed the instructions on the tailwindcss docs but its not formating my styles. I'm using next 13.4.9. Anyone know a fix?
1 replies