ATOMowy_grzyb
ATOMowy_grzyb
TTCTheo's Typesafe Cult
Created by Theonlyway on 11/16/2023 in #questions
Static rendering with conditional auth
then once PPR is functional it will do the static shell for you that will include the generic fallback avatar and your actual user avatar will get streamed in per user
5 replies
TTCTheo's Typesafe Cult
Created by Theonlyway on 11/16/2023 in #questions
Static rendering with conditional auth
wrap the user avatar in a Suspense where the fallback is a generic user icon/avatar and the actual avatar component uses cookies or whatnot (a session from Clerk) to do it's thing, making sure that the Clerk thing is Suspense-enabled (or that you use cookies, headers or noStore)
5 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
that is because a response of HTTP 400 You Done Goofed is not a failed request, it's a successful request that returned a HTTP error status
7 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
fetch("foo", { options })
.then((res) => { if !(res.ok) throw new Error('o shit'); return res.json(); })
.then((data) => doSomething(data)
.catch((e) => console.error(e));
fetch("foo", { options })
.then((res) => { if !(res.ok) throw new Error('o shit'); return res.json(); })
.then((data) => doSomething(data)
.catch((e) => console.error(e));
7 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
so
7 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
you need to check res.ok which will be false if the HTTP code of the response isn't in the 2xx range
7 replies
TTCTheo's Typesafe Cult
Created by BigBellyBigDreams on 11/16/2023 in #questions
Next.js fetch() not throwing error on failed request?
fetch does not throw on HTTP errors, it only throws on network errors
7 replies
TTCTheo's Typesafe Cult
Created by Mikołaj Kowal on 11/16/2023 in #questions
ISR error
you asked the same question in next.js discord with equally insufficient context, so now you get no help in 2 places at the same time 🎉
4 replies
TTCTheo's Typesafe Cult
Created by Glorrin on 11/16/2023 in #questions
server side ref
then you should extract that logic into a parent component that wraps the children it needs to control
6 replies
TTCTheo's Typesafe Cult
Created by Glorrin on 11/16/2023 in #questions
server side ref
and it's hard to understand what you're trying to do, let a component reference its siblings?
6 replies
TTCTheo's Typesafe Cult
Created by Glorrin on 11/16/2023 in #questions
server side ref
you don't "use server" components, that is for server actions
6 replies
TTCTheo's Typesafe Cult
Created by paanblogger on 11/10/2023 in #questions
Different folder structure
because you're comparing App Router to Pages Router
4 replies
TTCTheo's Typesafe Cult
Created by Crim on 11/4/2023 in #questions
Links within one another (nextjs)
my goodness, what is you line length, can you make that snippet readable?
6 replies
TTCTheo's Typesafe Cult
Created by G.A.S on 11/4/2023 in #questions
Issue with 'use client' Directive and SSR in Next.js: Conflicting Errors and Resolution"
you have "use client" because you have useState but you don't use the state for anything so it makes no sense
21 replies
TTCTheo's Typesafe Cult
Created by G.A.S on 11/4/2023 in #questions
Issue with 'use client' Directive and SSR in Next.js: Conflicting Errors and Resolution"
create an API route with a route handler that will handle your api.user.signup.mutate and call that over HTTP from the client component, or wrap the button in a form and use a server action on the form
21 replies
TTCTheo's Typesafe Cult
Created by G.A.S on 11/4/2023 in #questions
Issue with 'use client' Directive and SSR in Next.js: Conflicting Errors and Resolution"
separate your concerns, you're mixing client side code with server side code in one component, you can't do that
21 replies
TTCTheo's Typesafe Cult
Created by jack on 11/2/2023 in #questions
help interleaving server/client comps in layout?
I get that a lot and then I go and dig through docs and stuff because typically there's a new way of doing something I'm used to be doing in a certain way
31 replies
TTCTheo's Typesafe Cult
Created by jack on 11/2/2023 in #questions
help interleaving server/client comps in layout?
it does feel kinda weird that you have this piece of information you need right there in t he layout or the page, but it's hard to actually use it sometimes
31 replies
TTCTheo's Typesafe Cult
Created by jack on 11/2/2023 in #questions
help interleaving server/client comps in layout?
it's a client component already anyway, so one more hook won't hurt (tm)
31 replies
TTCTheo's Typesafe Cult
Created by Jai on 11/2/2023 in #questions
Restrict direct access to NextJS routes
this means you can't really keep aggregating the data client-side and send it once, or at least you have to send a progress update call from each page
5 replies