Next.js Discord

Discord Forum

[Error [PageNotFoundError]: Cannot find module for page: route not found /page] { code: 'ENOENT' }

Unanswered
Gouty oak gall posted this in #help-forum
Open in Discord
Gouty oak gallOP
Every time I go to localhost:3000 after starting the server, I get a next.js not-found page. The structure looks like the one in the picture, and the page normally exports the page. I have no idea how to fix this.

5 Replies

Gouty oak gallOP
Layout:
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { ClerkProvider } from "@clerk/nextjs";
import { dark } from "@clerk/themes";

const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <ClerkProvider appearance={{ baseTheme: dark }}>
      <html lang="en">
        <body
          className={`${geistSans.variable} ${geistMono.variable} antialiased`}
        >
          {children}
        </body>
      </html>
    </ClerkProvider>
  );
}

Page:
export default function Home() {
  return (
   <div>Page</div>
  );
}
I tried removing the node and next packages, but that still doesn't help. It will only help if I clear the entire folder and redo npx create-next-app@latest, but I can't do that because I'll have to redo the entire project from scratch, and I really want to solve this prob
show how you load the page in browser
considering that you said that your project got this issue at some point, try removing the last thing you added to the project before it stopped working
as a debug measurement