Next.js Discord

Discord Forum

Not found????

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

54 Replies

Avatar
HeadlessOP
Image
does it have something to do with the default js file?
Avatar
Jboncz
Have you tried removing the default.js file? 😄
Avatar
HeadlessOP
I need it for my modals to work right
they just return null
Avatar
Jboncz
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.
Avatar
HeadlessOP
yeah iof i remove
the default
it still doesnt work
Avatar
Jboncz
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.
Avatar
HeadlessOP
still wont work
Avatar
Jboncz
Interesting...
Does your about page work?
Avatar
HeadlessOP
it does on soft navigation
Avatar
Jboncz
not on hard?
Avatar
HeadlessOP
yeah
Avatar
Jboncz
Do you have a middleware?
Avatar
HeadlessOP
no
Avatar
Jboncz
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?
Avatar
HeadlessOP
actually
Avatar
Jboncz
localhost:3000/
Avatar
HeadlessOP
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
..
Avatar
Jboncz
Can you show me your layout.tsx?
In the root
Avatar
HeadlessOP
yeah 1 sec
confirming something
Avatar
Jboncz
Im assuming this is something 'new' and you have tested the navigation functionality prior to this issue occuring lol
Avatar
HeadlessOP
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
Avatar
HeadlessOP
i had to put a default.json inside the @reviewModal folder
Answer
Avatar
HeadlessOP
so it does not render anything if it does not exist
Avatar
Jboncz
😄
Yayy, GJ!
Avatar
HeadlessOP
thanks for the help