Next.js Discord

Discord Forum

Not found????

Answered
Headless posted this in #help-forum
Open in Discord
Why whenever I navigate to this page via the url bar it says 404 not found??
Answered by Headless
i had to put a default.json inside the @reviewModal folder
View full answer

54 Replies

does it have something to do with the default js file?
Have you tried removing the default.js file? 😄
I need it for my modals to work right
they just return null
Just remove it to see if its the issue, you will get navigated then an error when it tries to compile.
Thats okay, just remove it to validate that is in fact the issue.
Then we can begin a deeper dive.
But first step is determining the issue, then we can solve the issue.
yeah iof i remove
the default
it still doesnt work
Okay, so, what I want you to do is create a new folder called event1
then move just the page.tsx
then move the next thing
everytime reload the endpoint
till we find the issue.
still wont work
Interesting...
Does your about page work?
it does on soft navigation
not on hard?
yeah
Do you have a middleware?
no
That... is really strange, I was thinking it was maybe redirecting or something. Hrmmmm. So you said hard vs soft navigation, I take it your homepage works then?
actually
localhost:3000/
I have 6 pages total right
i cant hard naviage OR soft navigate any of them unless I go to the home page
and then start soft navigating
..
Can you show me your layout.tsx?
In the root
yeah 1 sec
confirming something
Im assuming this is something 'new' and you have tested the navigation functionality prior to this issue occuring lol
i found the root of the issue
got to figure out how to fix it
export default function RootLayout({
  children,
  reviewModal,
}: Readonly<{
  children: React.ReactNode
  reviewModal: React.ReactNode
}>) {
  return (
    <html lang="en">
      <body
        className={cn(
          "relative h-screen min-h-screen font-sans antialiased",
          fontSans.variable
        )}
      >
        <ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
          <div className="relative flex h-screen min-h-screen flex-col">
            <SiteHeader />
            <div className="flex h-full flex-1">
              {children}
              {reviewModal}
            </div>
          </div>
          <TailwindIndicator />
        </ThemeProvider>
      </body>
    </html>
  )
}
so
reviewModal
that im rendering
is the issue
this is prob some weird parralel route stuff
since its on the root
yp
ye
figured it out
i had to put a default.json inside the @reviewModal folder
Answer
so it does not render anything if it does not exist
😄
Yayy, GJ!
thanks for the help