steakfisher
steakfisher
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
thats the only solution I can think of tbh
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
a VERY messy solution for this could be making dashboard a dynamic route.. so that it ACCEPTS any child routes.. but regardless of the child route u can return a Dashboard 404
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
No description
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
it can have getStaticProps btw
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
k so apparently whats happening is U make a req for dashboard/blah, the server takes it, realizes the url doesnt exist, redirects u to /404 and then returns the html for 404 to the client But the client RECEIVING the html for that 404 page is still on dashboard/blah hence both of them have a different asPath, and hence the html returned by the server doesnt match the one being rendered on the client..
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
lemme see if I can figure smth out..
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
good god
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
also theres a decent chance a "use client" at the top MAY fix ur issue.. but not sure tho
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
while the client thinks its on dashboard?
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
y does the server think the user is on 404
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
do u know why..?
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
wait can u explain WHY it does that?
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
k so thats the problem.. lemme see how we can fix that
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
hold up.. so its logging 404 in the server and dashboard in the browser?
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
ye thats cuz its a server component
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
wait what
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
ye nah.. navigation is an app router thing..
43 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
can u try console logging asPath before the if statement?
43 replies
TTCTheo's Typesafe Cult
Created by paulrvach on 8/17/2023 in #questions
Download individual components through the CLI
the project is open source, hence the cli code is also available at https://github.com/shadcn-ui/ui/tree/main/packages/cli
2 replies
TTCTheo's Typesafe Cult
Created by Casal0x on 8/17/2023 in #questions
Custom 404 page with multiple layouts
ur error is caused because ur client realizes dashboard is included in ur url (hence the if condition returns true) but ur server decides its false fsr.. Which leads me to believe it has something to do with the router Looking at the nextjs docs and comparing I noticed the import statement.. so it COULD be the solution?
43 replies