I've been stuck on this screen for 7 days with the 404 error message
This page could not be found.
Can anyone help me?
This 404 error can mean two different things. We just need to find out which one it is.
-
An “App 404”: Your Next.js app is running, but it can’t find the specific page (e.g., your homepage).
-
An “Environment 404”: The Firebase Studio preview window isn’t connected to your running app.
Let’s Find Out Which 404 It Is
Here is the most important test:
-
In your Terminal, run your Next.js app. The most common command is:
Bash
npm run dev -
Wait for it to say “Ready” or “Compiled.”
-
Have your Preview window open (with the 404 error).
-
Refresh the Preview window.
-
Now, look at your Terminal log immediately.
What Did Your Terminal Do?
Scenario A: You see GET / 404 in your terminal
If new lines appeared in your terminal, especially something like GET / 404, this is great news!
-
What it means: The environment is working. The preview window is talking to your Next.js app. The problem is that Next.js itself is serving the 404.
-
The Fix: This almost always means you are missing your main homepage file.
-
Check your project: Do you have a file at
src/app/page.tsx(orapp/page.tsxif you aren’t using asrcfolder)? -
If not, ask the AI agent: “Create a simple homepage component at
src/app/page.tsx”
-
Scenario B: You see nothing new in your terminal
If you refreshed the preview and absolutely nothing new appeared in your terminal log, this means the environment is the problem.
-
What it means: The preview window is not correctly connected to your running app.
-
The Fix: The best fix is to “Hard Restart” the entire workspace VM. This clears any stuck processes.
-
Press
Cmd+Shift+P(on Mac) orCtrl+Shift+P(on Windows/Linux) to open the command palette.1 -
Type in
Firebase Studio: Hard Restart. -
Select that option and press Enter.
-
After it reboots, try
npm run devagain.
-
What to Do Next
The fastest way to get this solved is to run npm run dev in your terminal and then paste the log here.
That log will tell us instantly if it’s Scenario A or B. We’re here to help!
