[CRITICAL BUG] Next.js App Hosting: Firebase Storage Upload Fails (Stuck at 0%) Despite Working Firebase Auth

Hello,

I am encountering a critical bug with file uploads on a Next.js application deployed via Firebase App Hosting. File uploads to Firebase Storage consistently fail, getting stuck at 0% progress without any explicit console error.

Technical Context:

  1. Platform: Next.js (App Router), deployed on Firebase App Hosting.
  2. Authentication: Firebase Auth is fully functional. User sign-up and login are successful. Writes to the secondary Firestore database (optivalai) also succeed. The user is definitely authenticated on the client side.
  3. Service Targeted: Firebase Storage (Google Cloud Storage).

Confirmed Issue Details:

  • The upload process starts but immediately stalls at 0%.
  • The Storage Security Rules are set to allow authenticated users: allow write: if request.auth != null;.

Analysis Conclusion:
The failure at 0% on a signed-in user with permissive rules suggests the upload request is reaching the Storage server without the necessary authentication token (request.auth is null).

I believe this is an integration bug within the Firebase App Hosting / Next.js adapter where the client-side user token is not being correctly propagated or validated for the Google Cloud Storage API calls.

Could the Google development team please investigate this infrastructure-level token propagation issue between the Next.js adapter and Cloud Storage? Thank you for your urgent attention.