404 Error :- This Page could not be loaded

I dont know why yesterday at night my last prototype chat was working fine all set by errors and but i got this error as i havnt touch the next js or package so that this will happen

how to solve this

2025-06-29T04:51:38Z [web] :play_button: Preview running
2025-06-29T04:51:38Z [web] β–² Next.js 15.2.3
2025-06-29T04:51:38Z [web] - Local: http://localhost:9002
2025-06-29T04:51:38Z [web] - Network: http://0.0.0.0:9002
2025-06-29T04:51:38Z [web] - Environments: .env
2025-06-29T04:51:38Z [web] - Experiments (use with caution):
2025-06-29T04:51:38Z [web] Β· allowedDevOrigins
2025-06-29T04:51:38Z [web]
2025-06-29T04:51:38Z [web] βœ“ Starting…
2025-06-29T04:51:46Z [web] βœ“ Ready in 8s
2025-06-29T04:51:46Z [web] β—‹ Compiling /_not-found …
2025-06-29T04:52:14Z [web] βœ“ Compiled /_not-found in 28.4s (680 modules)
2025-06-29T04:52:16Z [web] GET /?monospaceUid=0 404 in 18149ms
2025-06-29T04:52:16Z [web] GET /?monospaceUid=240047 404 in 18078ms
2025-06-29T04:52:16Z [web] GET / 404 in 30155ms

2 Likes

Exactly the same problem right now for me

We are currently investigating an issue preventing some workspaces from opening. Status

Ohh thanks sir for taking up a action on this but actually I just solved the error

The error is like my website of next js which is loaded in src/app folder but gemini prototyper is using app/ so it’s causing error now in my repo the main code is in src/app which to navigate to all pages in app/ there is redirect link created for all pages and for those who have not created a redirect link in app folder will show 404 error

I can help in detail as I just found the error actually is

same with you, first ,i think for my code is wrong, but i sure that is coke, so i see your post, anyone have update for issue ?

has anyone been able to solve the 404 issue yet? is working fine and perfectly locally but is not working on the firebase environment

Hey everyone,
I’ve encoutered the same Error and want to share my steps for fixing my App. My Next.js build process consistently defaulted to the pages router, completely ignoring my src/app directory, even though my project was set up to use the App Router.

The Symptom

When running npm run build, the output would always show the pages router, like this:

Route (pages) ─ β—‹ /404

This happened despite the fact that I had no /pages folder and had correctly set up my project with a src/app directory, including the required layout.tsx and page.tsx files.

What I Tried (That Didn’t Work)

I went through all the standard troubleshooting steps:

  • Ensuring src/app/layout.tsx and src/app/page.tsx existed and had correct content.
  • Deleting the .next folder and node_modules and reinstalling everything.
  • Simplifying my next.config.js to rule out configuration issues.

None of these steps solved the problem.

The Root Cause & Solution

The issue was surprisingly simple: There was a folder named app in the root directory of my project.

β”œβ”€β”€ app/ ← THE CONFLICTING FOLDER
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ app/ ← The correct App Router directory
β”‚ β”‚ β”œβ”€β”€ layout.tsx
β”‚ β”‚ └── page.tsx
β”œβ”€β”€ package.json
└── …

On case-insensitive file systems, the Next.js build process got confused by the presence of both an app folder and a src/app folder. This conflict caused it to fail to recognize the src/app directory correctly and fall back to the pages router as a default.

The solution was to simply delete the conflicting app folder from the project’s root.

After deleting it and running npm run build again, the build process immediately recognized the src/app directory, and my routes were built correctly.

3 Likes

Thanks a lot!! I fixed the problom, you really saved my project!

facing same issue. any help?

amazing observation buddy. it was indeed surprisingly simple. saved my project.

thanks bro u just saved me