Bundle Analyze Gate Report
===========================
Ticket: 3269 (Forgot Password / Password Reset Flow)
Date: 2026-09-04
Changed Routes/Components:
  - middleware.ts
  - app/(auth)/forgot-password/page.tsx
  - app/(auth)/verify-otp/page.tsx
  - app/(auth)/reset-password/page.tsx
  - components/auth/ForgotPasswordForm.tsx
  - components/auth/VerifyOtpForm.tsx
  - components/auth/CompleteResetForm.tsx

BUILD STATUS: FAILED
====================

The Next.js production build failed during compilation with the following error:

Error in: ./lib/actions/forgot-password.ts:52:1

Issue: Only async functions are allowed to be exported in a "use server" file.

The file contains a non-async constant export:
  export const RESET_FLOW_COOKIE = "oms_reset_flow";

This violates Next.js Server Actions rules which require that all exports from
files marked with "use server" directive must be async functions. Constants
and non-async exports are not permitted in Server Action files.

The build could not complete, therefore bundle analysis cannot be performed.

RECOMMENDATION:
To fix this issue, move the constant RESET_FLOW_COOKIE to a non-server file
(e.g., a separate constants.ts file that does not have the "use server"
directive), then re-export it in the Server Action file if needed.

Full build error output:
  Error:
    [31mx[0m Only async functions are allowed to be exported in a "use server" file.
      ,-[[36;1;4m/opt/drcarrot-deploy/cross-repo-orchestration/oms-web/lib/actions/forgot-password.ts[0m:49:1]
   [2m49[0m | // Constants (must stay in sync with lib/queries/forgot-password.ts)
   [2m50[0m | // ---------------------------------------------------------------------------
   [2m51[0m |
   [2m52[0m | export const RESET_FLOW_COOKIE = "oms_reset_flow";
      : [31;1m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
   [2m53[0m |
   [2m54[0m | /** Total lifetime of one OTP (10 minutes). */
   [2m55[0m | const OTP_TTL_MS = 10 * 60 * 1_000;
      `----

Import trace for requested module:
./lib/actions/forgot-password.ts
./components/auth/ForgotPasswordForm.tsx

  Import trace for requested module:
    ./lib/actions/forgot-password.ts
    ./lib/forgot-password/index.ts
    ./app/(auth)/verify-otp/page.tsx
