> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel Deployment Configuration

> Build and Ignored Build Step behavior for the Encore Health OS app are defined in the repo’s vercel.json. Keep Vercel Project Settings in sync with that file s…

Build and Ignored Build Step behavior for the Encore Health OS app are defined in the repo’s [vercel.json](../../vercel.json). Keep **Vercel Project Settings** in sync with that file so deployments are consistent and the "Configuration Settings differ" warning does not appear.

## Project Settings alignment

In **Vercel → Project → Settings → General** and **Build & Development**, set:

| Setting                | Value (matches vercel.json)                                                                                        |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Framework Preset**   | Vite                                                                                                               |
| **Build Command**      | `npm run build`                                                                                                    |
| **Output Directory**   | `dist`                                                                                                             |
| **Install Command**    | `npm ci`                                                                                                           |
| **Ignored Build Step** | **Custom**, with: `git diff --quiet HEAD^ HEAD -- src/ public/ vite.config.ts package.json vercel.json index.html` |
| **Node.js Version**    | **22.x** (aligned with `package.json` `engines.node`)                                                              |

After saving, trigger a **new production deployment** (push to production branch or Redeploy). Once it completes, production will match Project Settings and the configuration-diff warning should clear.

## Ignored Build Step behavior

* **Exit 0** → build is **skipped**.
* **Exit 1** → build **runs**.

The custom command compares the last commit to its parent for the listed paths. Only changes under `src/`, `public/`, `vite.config.ts`, `package.json`, `vercel.json`, and `index.html` trigger a build; docs/specs-only changes skip it. The same command is in `vercel.json` so behavior is version-controlled for preview and production.

## Build troubleshooting

* **Module not found (e.g. `sanitize-error-message`):** Imports must resolve to real files. Use `@/shared/lib/error-utils` for `sanitizeErrorMessage`; there is no `sanitize-error-message` module. Fix any invalid or duplicate imports and re-run `npm run build` locally before pushing.
* **npm deprecation warnings during install:** Keep `engines.node` in the **22–24** range per `package.json`. Node version for Vercel builds is controlled via **Project Settings → Build & Development → Node.js Version** and via `package.json` `engines.node` (which can override Project Settings). Do not use `vercel.json` `build.env.NODE_VERSION` as it is ineffective for runtime selection. Spreadsheet code uses `@wekanteam/exceljs` (maintained fork). `package.json` **overrides** bump nested `glob` / `rimraf` / `source-map` where safe; some install-time warnings can still appear from deep dev-tool trees.

## References

* [Vercel: vercel.json](https://vercel.com/docs/project-configuration/vercel-json)
* [Vercel: Ignored Build Step](https://vercel.com/docs/project-configuration/project-settings#ignored-build-step)
* [Canonical Host Policy (domains)](./canonical-host-policy.md)
