This page documents the most frequently encountered problems when setting up and running FerreMarket, along with their root causes and step-by-step fixes. Issues are grouped by symptom. If your problem is not listed here, check the browser DevTools console for error messages — most FerreMarket errors surface there with enough detail to identify the cause.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProyectoFerretek/FerreMarket/llms.txt
Use this file to discover all available pages before exploring further.
Redirected to /admin/login on every page load
Redirected to /admin/login on every page load
AuthContext provider reads the current Supabase session on mount and starts in an undefined state while the async check is in flight. If VITE_SUPABASE_URL or VITE_SUPABASE_ANON_KEY are missing or incorrect, the Supabase client never resolves a session and the session value remains null. Any protected route that checks for a valid session immediately redirects unauthenticated users to /admin/login.FixVerify your environment variables
.env at the project root and confirm both Supabase variables are present and non-empty:Restart the Vite dev server
.env at startup. If you edited the file while the server was running, the changes are not picked up automatically. Stop the server with Ctrl+C and run npm run dev again.Create a user in Supabase Auth
Wait for the session to resolve
session state in AuthContext is undefined while the initial supabase.auth.getSession() call is in progress — this is intentional to distinguish “not yet checked” from “definitely logged out”. Protected routes should render a loading indicator while session === undefined and only redirect when session === null. If you see an instant redirect with no loading state, the Supabase client initialisation itself is failing — check the DevTools console for a supabase client error.Blank page after npm run dev
Blank page after npm run dev
VITE_SUPABASE_URL or VITE_SUPABASE_ANON_KEY resolved to undefined — which happens when the .env file does not exist or has not been populated.FixCheck that .env exists
Check the browser console for errors
F12), click the Console tab, and look for a red error message. A message like createClient: supabaseUrl is required confirms the env var is not being read.Restart the dev server
.env, stop the Vite dev server (Ctrl+C) and restart it:PDF invoice generation fails
PDF invoice generation fails
jspdf and jspdf-autotable to generate invoice PDFs in src/pages/Reportes.tsx. If either package is missing from node_modules (e.g. after a partial install or a corrupted lockfile), the import throws at runtime and PDF generation silently fails or throws an uncaught error.FixReinstall all dependencies
package.json is present:jspdf and jspdf-autotable appear in the output or verify they are in node_modules:TypeScript errors on build
TypeScript errors on build
strict: true in tsconfig.app.json along with noUnusedLocals and noUnusedParameters, which means a wider class of code patterns are rejected compared to a default TypeScript setup. Common sources of errors include: type mismatches between Supabase query return types and component props, missing type declarations for a dependency, or implicit any in callback arguments.FixRun the type-checker directly
npm run build.Check for missing @types packages
@types/luxon is absent from devDependencies. Confirm it is installed:package.json under devDependencies as "@types/luxon": "^3.6.2". Run npm install to restore it.Review strict null checks
strict: true enabled, TypeScript will not allow values that could be null or undefined to be used without a null check. The most common pattern in FerreMarket is checking whether a Supabase query returned data before passing it to a component. Add a guard such as if (!data) return or use optional chaining (data?.field).Supabase Edge Function returns 404
Supabase Edge Function returns 404
create-user, delete-user, and send-password-recovery-email — from the admin user management screens. A 404 response means the function URL was reached but no deployed function was found at that name. This happens when the functions have not yet been deployed to the Supabase project, or were deployed to a different project than the one referenced by VITE_SUPABASE_URL.FixInstall and log in to the Supabase CLI
Link your local project to Supabase
<project-ref> with the value found in Project Settings → General → Reference ID:Product images not loading
Product images not loading
VITE_CLOUDFLARE_CDN_URL to the stored image path. If this variable is not set, all image src attributes resolve to an invalid URL and the browser shows a broken image icon. A secondary cause is that the Cloudflare R2 bucket exists but has not been configured for public access — requests to the CDN URL return 403 Forbidden.FixSet VITE_CLOUDFLARE_CDN_URL in .env
.env:Enable public access on the R2 bucket
pub-xxxx.r2.dev URL — use this as the value of VITE_CLOUDFLARE_CDN_URL.Charts not rendering in Dashboard
Charts not rendering in Dashboard
productos, clientes, or ventas tables do not exist, have different column names than expected, or the anon key does not have SELECT permissions due to a missing Row Level Security policy.FixCheck the browser console for Supabase errors
{ error, status, statusText }. The error.message field tells you exactly which table or column is the problem.Verify the required tables exist in Supabase
productos— product catalog (name, price, stock, category, etc.)clientes— customer records (name, email, phone, etc.)ventas— sales transactions (date, total, client reference, etc.)
supabase/migrations/ directory (if present) or create the tables manually.Check Row Level Security policies
SELECT policy that allows public or authenticated access. Without a permissive policy, queries return an empty result set rather than an error, which produces blank charts.