Shipped by Prompt
Menu

Fixes for Netlify deploy errors

The problems people report most on the Netlify support forum when they deploy a Vite or React app, in their own words, with the fix that worked.

By shipwright, updated

Read the guide

A class page of the demo app opened directly by its address, with no Page not found error

Lovable and Bolt export the same kind of app: React, built with Vite, often with Supabase behind it. That means the same handful of problems come up again and again when these apps meet Netlify. The list below comes from threads on Netlify's own support forum, answers.netlify.com. Each entry has the symptom as people describe it, what causes it, and the fix. Every thread is linked at the bottom of the page.

Find your symptom, apply the fix, redeploy.

"Page not found" when I refresh a page

Symptom. The home page loads. You click around and everything works. Then you refresh, or open a link someone sent you to /dashboard, and Netlify shows "Page not found". One forum thread title says it plainly: "Page not found everytime I refresh the loaded page".

Cause. The app is a single-page app. Only index.html exists as a real file; the app's JavaScript draws the other pages. Netlify gets a request for /dashboard, finds no file there, and returns a 404.

Fix. Add a rewrite rule that sends every path to index.html with status 200. Put a file named _redirects (no extension) in the public folder of the project, containing:

/* /index.html 200

Or add the same rule as a [[redirects]] block in netlify.toml. Netlify's own page-not-found guide lists this as the fix for single-page apps. Full walkthrough in step 4 of the deploy guide.

"Build failed" with Vite and React

Symptom. The deploy log ends in an error, often about a missing folder, or the build passes but the site is empty.

Cause. The publish directory is wrong. Older React apps (Create React App) put their output in a build folder; Vite uses dist. If the setting points at build, Netlify cannot find the files.

Fix. In the project's build settings, or in netlify.toml, set the publish directory to dist and the build command to npm run build. Then trigger a new deploy.

The form shows up in Netlify, but submissions never arrive

Symptom. "Forms with React are recognized but submits are not captured". The Forms tab lists your form, yet test entries never appear.

Cause. Netlify detected the static copy of the form, but the React form sends its data in a way Netlify does not accept, usually as JSON, or without the hidden form-name field.

Fix. Keep a hidden static copy of the form, with the same field names, in index.html. Post the React form as application/x-www-form-urlencoded data and include a hidden input named form-name whose value matches the form's name. The Netlify Forms guide has working code for both parts.

Environment variables are undefined after deploy

Symptom. "Unable to access Netlify environment variables". The app works in the builder, but on Netlify the API URL or key comes through as undefined.

Cause. Two things combine. Vite only exposes variables whose names start with VITE_ to the app's code, and it reads them through import.meta.env, not process.env. Also, Vite writes the values into the files at build time, so a variable added after the last deploy is not in the live site yet.

Fix. Name the variable with the VITE_ prefix in Netlify (for example VITE_API_URL), read it with import.meta.env.VITE_API_URL, and trigger a new deploy after adding or changing it.

Remember what the prefix means: anything named VITE_ ends up in files every visitor downloads. That is fine for a Supabase publishable key, and never fine for a secret key. Where API keys leak, and how to keep them server-side.

Supabase says "Legacy API keys disabled"

Symptom. Login or data loading fails with a Supabase error such as "Legacy API keys disabled", even though the keys look right.

Cause. In the forum thread with this error, the fixes pointed at the key not reaching the app correctly, and at a second, hardcoded Supabase client in the code overriding the one built from environment variables. AI builders sometimes create the client twice: once with the keys pasted in, once reading them from the environment.

Fix. Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY (or the variable names your code actually uses) in Netlify's environment variables. Search the code for createClient and make sure there is only one, built from import.meta.env values. If the old keys in the code have been switched off in Supabase, copy the current publishable key from the Supabase dashboard. Redeploy.

Custom domain stuck on "Waiting on DNS propagation"

Symptom. "Custom domain stuck on Waiting on DNS propagation", sometimes for two days or more.

Cause. Usually a record that still points somewhere else: an old A record from a parking page, a previous host's record, or a record on the wrong name.

Fix. Check that the apex domain points at Netlify (an ALIAS/ANAME record to your Netlify address, or an A record to 75.2.60.5), that www is a CNAME to your .netlify.app address, and that no other record exists for the same names. If everything is right and it is still stuck, removing the domain in Netlify's domain settings and adding it again restarts verification. Details in the domain guide.

HTTPS certificate stuck "provisioning"

Symptom. The domain resolves, but the padlock never appears: "stuck provisioning SSL certificate for hours". The forum thread was from someone who had moved their domain over from Wix.

Cause. Leftover records from the previous host, often AAAA (IPv6) records, still send part of the traffic elsewhere, so Let's Encrypt cannot verify the domain. A CAA record that does not allow Let's Encrypt causes the same failure.

Fix. Delete AAAA records left by the old host, check any CAA record includes Let's Encrypt, then use Renew certificate in the HTTPS section of the domain settings.

"This site was paused as it reached its usage limits"

Symptom. Visitors see "Site not available" instead of your app.

Cause. The account ran out of credits for the month. On the Free plan the limit is hard, and Netlify pauses every project on the account, not just the busy one.

Fix. To get back online at once, upgrade the plan or buy more credits. On the Free plan, projects resume when the next monthly cycle starts. To avoid it next month, cut the number of production deploys; Is Netlify's free plan enough? shows where the credits go.

Still stuck?

Search answers.netlify.com with the exact error from your deploy log. Most errors have a thread, and Netlify's support team answers there. When you post, include the project name, the deploy log lines around the error, and what you already tried.

Sources, checked by hand

  1. Netlify forum: Page not found every time I refresh2026-10-31
  2. Netlify forum: Build failed using vite+react2026-10-31
  3. Netlify forum: Forms with React are recognized but submits are not captured2026-10-31
  4. Netlify forum: Unable to access environment variables with Vite and React2026-10-31
  5. Netlify forum: VITE_SUPABASE_ANON_KEY not injecting correctly2026-10-31
  6. Netlify forum: Custom domain stuck on Waiting on DNS propagation2026-10-31
  7. Netlify forum: Custom domain stuck provisioning SSL certificate2026-10-31
  8. Netlify forum: Site paused as it reached its usage limits2026-10-31
  9. Netlify docs: Page not found error guide2026-10-31
  10. Vite: Env variables and modes2026-10-31