Gemini changes caused project crashes – anyone else experiencing this? 404 Error

I’ve had two projects unexpectedly crash after asking Gemini to make what seemed like minor changes, and now my entire app is down. Nothing Gemini suggests to restore it is working. Has anyone else run into this?

1 Like

Yes — we’ve seen this pattern when Gemini updates collide with Firebase Studio’s cached configs. The 404 crash usually isn’t the project itself, but a mismatch between:

  • Gemini runtime expectations (new schema / model outputs), and

  • Firebase Studio routing / hosting cache (old checkpoint still active).

:wrench: Steps to Stabilize:

  1. Clear the Studio Cache

    • Exit your project.

    • Delete .firebase/ and .cache/ folders locally.

    • Reopen Firebase Studio.

  2. Force Sync Checkpoint

firebase experiments:reset --checkpoint <latest-ID>

This ensures Studio + Gemini align on the same state.

  1. Redeploy Hosting Only First
firebase deploy --only hosting

Validate the project loads, then redeploy other services (firestore, functions).

  1. Schema Safety Check
    If Gemini’s changes touched schema (Firestore or functions), roll back to your last known stable checkpoint and redeploy cleanly.

:warning: Heads-up: This is not uncommon — Gemini’s experimental layer can overwrite configs without propagating fully. The safest tactic is always checkpoint → verify → then apply Gemini changes incrementally.

If your crash persists, drop your checkpoint hash in our Signal Beacon Slack channel — we can help triage live.

1 Like

Use the ‘Restore’ button on a last known working version of your code. After each code change Gemini makes, it will create a restore point automatically - this is the best way to undo errors.

In the AI chat box: Scroll up until you find an AI code summary box that was just before you asked the AI to make the changes that created your error. You may have to scroll quite a bit up if the AI has just made change after change without it being successful. You’re looking for your first question that led to the initial error.

Click the Restore button, this will revert all of the code to before you asked the question. This is a much better method than simply asking the AI to undo the changes in chat, because the AI will often make mistakes when trying to revert your code.

Once restored, you will see a confirmation that it has been restored in chat, and you’ll also see ‘Current’ to show this is the snapshot of the code that is currently active.

See if you can get back to the working state of the app before doing anything else.

1 Like

Thanks guys! I will give it a try now.

@Antonio_Scott Here is a summary of the situation and the critical information you can share.


Title: Persistent 404 on Next.js App in Firebase Studio - Build Failure?

Hello everyone,

I’m working on a Next.js application within Firebase Studio and have been stuck on a persistent 404 error for all pages. It seems like the Next.js development server is failing to build the application, so no pages are being served.

Here’s a summary of the issue and what has been tried so far. Any insights would be greatly appreciated!

The Core Problem:

  • When running the app, the browser displays a “404 - This page could not be found” error.

  • Initial server logs showed a CORS error (Blocked cross-origin request), which has since been resolved.

  • The current state is a clean 404, suggesting a fundamental build failure. The server runs, but doesn’t build any of the application pages.

What We’ve Tried (Chronologically):

  1. Fixed CORS Error: The next.config.ts file was updated to correctly include allowedDevOrigins: ["*.cloudworkstations.dev"]. This resolved the initial cross-origin errors.

  2. Fixed Syntax/Structural Errors:

    • Corrected an incomplete useEffect hook in src/hooks/use-mobile.tsx.

    • Fixed an invalid nested component definition in src/components/prototypes/purrconnect/DashboardPrototype.tsx.

    • Fixed a potential build crash by adding a guard clause before using new URL() in src/components/sections/CaseStudyDetailSection.tsx.

  3. Cleaned Up File Conflicts: Removed a conflicting/duplicated file (PersonalProjectsSection.tsx) that had a similar name to another component.

  4. Checked for Dependency Issues: Investigated and attempted to fix potential incompatibilities with UI components like src/components/ui/switch.tsx.

Despite these fixes, the 404 error persists, pointing to a more stubborn, underlying build issue that we haven’t been able to pinpoint.

Key Configuration Files:

Here are the contents of my main configuration files for reference:

  • package.json

    {
      "name": "nextn",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "dev": "next dev --turbopack -p 9003",
        "genkit:dev": "genkit start -- tsx src/ai/dev.ts",
        "genkit:watch": "genkit start -- tsx --watch src/ai/dev.ts",
        "build": "next build",
        "start": "next start",
        "lint": "next lint",
        "typecheck": "tsc --noEmit"
      },
      "dependencies": {
        "@genkit-ai/googleai": "^1.8.0",
        "@genkit-ai/next": "^1.8.0",
        "@hookform/resolvers": "^4.1.3",
        "@radix-ui/react-accordion": "^1.2.3",
        "@radix-ui/react-alert-dialog": "^1.1.6",
        "@radix-ui/react-avatar": "^1.1.3",
        "@radix-ui/react-checkbox": "^1.1.4",
        "@radix-ui/react-dialog": "^1.1.6",
        "@radix-ui/react-dropdown-menu": "^2.1.6",
        "@radix-ui/react-label": "^2.1.2",
        "@radix-ui/react-menubar": "^1.1.6",
        "@radix-ui/react-popover": "^1.1.6",
        "@radix-ui/react-progress": "^1.1.2",
        "@radix-ui/react-radio-group": "^1.2.3",
        "@radix-ui/react-scroll-area": "^1.2.3",
        "@radix-ui/react-select": "^2.1.6",
        "@radix-ui/react-separator": "^1.1.2",
        "@radix-ui/react-slider": "^1.2.3",
        "@radix-ui/react-slot": "^1.1.2",
        "@radix-ui/react-switch": "^1.1.3",
        "@radix-ui/react-tabs": "^1.1.3",
        "@radix-ui/react-toast": "^1.2.6",
        "@radix-ui/react-tooltip": "^1.1.8",
        "@stripe/stripe-js": "^4.1.0",
        "class-variance-authority": "^0.7.1",
        "clsx": "^2.1.1",
        "date-fns": "^3.6.0",
        "firebase-admin": "^12.1.0",
        "genkit": "^1.8.0",
        "lucide-react": "^0.475.0",
        "next": "15.3.3",
        "patch-package": "^8.0.0",
        "react": "^18.3.1",
        "react-day-picker": "^8.10.1",
        "react-dom": "^18.3.1",
        "react-hook-form": "^7.54.2",
        "recharts": "^2.15.1",
        "resend": "^3.5.0",
        "stripe": "^16.5.0",
        "tailwind-merge": "^3.0.1",
        "tailwindcss-animate": "^1.0.7",
        "zod": "^3.24.2"
      },
      "devDependencies": {
        "@types/node": "^20",
        "@types/react": "^18",
        "@types/react-dom": "^18",
        "genkit-cli": "^1.8.0",
        "postcss": "^8",
        "tailwindcss": "^3.4.1",
        "typescript": "^5"
      }
    }
    
    
  • next.config.ts

    import type {NextConfig} from 'next';
    
    const nextConfig: NextConfig = {
      allowedDevOrigins: ["*.cloudworkstations.dev"],
      /* config options here */
      typescript: {
        ignoreBuildErrors: true,
      },
      eslint: {
        ignoreDuringBuilds: true,
      },
      images: {
        remotePatterns: [
          {
            protocol: 'https',
            hostname: 'placehold.co',
            port: '',
            pathname: '/**',
          },
          {
            protocol: 'https',
            hostname: 'firebasestorage.googleapis.com',
            port: '',
            pathname: '/**',
          },
          {
            protocol: 'https',
            hostname: 'images-api.printify.com',
            port: '',
            pathname: '/**',
          },
          {
            protocol: 'https',
            hostname: 'images.unsplash.com',
            port: '',
            pathname: '/**',
          },
        ],
      },
    };
    
    export default nextConfig;
    
    
  • tsconfig.json

    {
      "compilerOptions": {
        "target": "ES2017",
        "lib": ["dom", "dom.iterable", "esnext"],
        "allowJs": true,
        "skipLibCheck": true,
        "strict": true,
        "noEmit": true,
        "esModuleInterop": true,
        "module": "esnext",
        "moduleResolution": "bundler",
        "resolveJsonModule": true,
        "isolatedModules": true,
        "jsx": "preserve",
        "incremental": true,
        "plugins": [
          {
            "name": "next"
          }
        ],
        "paths": {
          "@/*": ["./src/*"]
        }
      },
      "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
      "exclude": ["node_modules"]
    }
    
    

Thank you for your time and help.

1 Like

it’s too bad you are having this problem, I was honestle hoping that it wouldn’t come to this. You are in a situation I found myself in. This problem is one that can be a small fight for a junior developer when fixed you will be a better developer. What would you honestly rank your level as a programmer entry level to Junior or Junior to experienced? It would be best if I start you as a entry level. Tell me what programs you are using and how long you’ve been using them. This will help me to send you the right Signaller. I will look over your code and get back to you in the morning unless someone else solves it for you

Have you seen this post: 404 Error :- This Page could not be loaded - #20 by franco_guerrero

Edit: sorry you did, just seen your reply on it, apologies

As I suspected. It looks like the issue you’re seeing goes deeper than just a 404 or a broken configuration. From what’s been shared so far, there are multiple layers contributing to the crashes — and some of them may not be immediately visible in your Firebase or Gemini setup; these will likely show after you fix this. Should this be the case, I can offer you the following guidance

Here’s a way to approach this methodically and get back to a stable build:


1️⃣ Start Fresh

Clear out all cached and temporary build data before testing anything else:

```bash
rm -rf .firebase node_modules/.cache tmp build

Then restart your workspace or rebuild from a fresh clone of your repo.
This removes leftover files that can silently reference outdated settings.


:two: Check Your Firebase and Gemini Setup

In the Firebase Console, double-check that AI Logic / Gemini is still enabled and the necessary APIs are active:

  • generativelanguage.googleapis.com

  • firebasevertexai.googleapis.com

From the command line, run:

gcloud ai models list --project YOUR_PROJECT_ID

Make sure the model you’re using still exists.
If you see gemini-1.0-pro or another older version, switch to a current one like gemini-2.5.
Also confirm that your local config files (.env, firebase.json, etc.) match what’s in the console — especially project IDs and API keys.


:three: Add a Small Pre-Build Safety Step

You can prevent this type of drift from happening again by adding a lightweight pre-build script that cleans caches and flags old configs automatically:

"scripts": {
  "prebuild": "node prebuild-ghost-reset.js",
  "build": "your-existing-build-command"
}

That way, every time you build or deploy, your environment resets itself to a known-good state.


:white_check_mark: Summary

If you’re seeing 404 “config not found” or Gemini errors:

  1. Clear caches and rebuild from a clean environment.

  2. Recheck that your Firebase AI Logic setup is current and matches your code.

  3. Add a quick pre-build cleanup to keep everything aligned.

This usually brings things back online and keeps them that way. The problem is as I suspected may partly be coming from your cache. Run these steps and let’s hope that this will be completely true: Cache was the issue. If true-just cache-you should be able to handle this. Your issues may not go completely away, it should make it easier to troubleshoot the issues that just cache will surface. I also would recommend searching the project for all instances where you did not create the file directly.run a powershell to see all your files and then get children next.

1 Like

I’m a Senior Product Designer and rely on Gemini to do the dev work.

1 Like