Skip to content

Windows frontend build troubleshooting

Use this page when a Windows development checkout is up to date but the local UI still looks old, or when npm install and frontend builds fail on a corporate network.

Assumptions:

  • Windows PowerShell is used for commands.
  • Node.js is version 20.19 or newer.
  • The checkout root is represented as <repo-root>.
  • Your corporate root certificate is installed in Windows.

Symptoms:

  • git pull or git fetch brings in frontend changes.
  • Browser still shows the old Jarvis UI at the local address.
  • New buttons, screens, or text that exist in source code do not appear.

Root cause:

The local startup scripts only build the frontend bundle when the built frontend/dist/index.html file is missing. If an old dist directory already exists, the backend keeps serving that old static bundle.

Fix:

Rebuild the frontend after pulling frontend changes:

Terminal window
Set-Location <repo-root>\frontend
npm run build

Then hard refresh the browser with Ctrl+Shift+R. If the app is still stale, open DevTools, unregister the service worker, and refresh again.

You usually do not need to restart the backend for this specific case because the static files are read from disk after the new dist is written.

Symptom:

SELF_SIGNED_CERT_IN_CHAIN

Root cause:

A corporate TLS-inspecting proxy re-signs registry traffic with a company root certificate. Node and npm may not trust that root certificate unless you provide an extra certificate bundle.

Fix:

Point NODE_EXTRA_CA_CERTS at a PEM bundle that contains the company root certificate:

Terminal window
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"
npm ping

npm ping should return PONG. The environment variable applies to the current shell. Add it to your user environment variables if you want it to persist across new PowerShell sessions.

Prefer npm install over npm ci on managed networks

Section titled “Prefer npm install over npm ci on managed networks”

Symptoms:

  • npm ci fails after registry or audit requests.
  • npm prints Exit handler never called!.
  • Later builds fail because tools such as vite or vue-tsc are not found.

Root cause:

npm ci removes node_modules before reinstalling from the lockfile. If npm then fails while talking to the registry or audit service, the checkout can be left with a partially installed dependency tree. The .bin shims may be empty or packages may be missing their package.json files.

Fix:

Use npm install with certificate trust configured and audit disabled:

Terminal window
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"
Set-Location <repo-root>\frontend
npm install --no-audit --no-fund

This repairs missing packages without first deleting the whole dependency tree.

Inspect the command shims:

Terminal window
Get-ChildItem <repo-root>\frontend\node_modules\.bin

If the directory is empty or nearly empty, reinstall dependencies:

Terminal window
Set-Location <repo-root>\frontend
npm install --no-audit --no-fund

You can also inspect a package directory that the build complains about. If the package directory exists but has no package.json, the dependency tree is incomplete and should be repaired with npm install.

If .bin shims are missing but the Vite package itself is installed, you can build the static frontend by calling Vite’s JavaScript entry directly:

Terminal window
Set-Location <repo-root>\frontend
node node_modules\vite\bin\vite.js build

Use this only as a temporary recovery step. It builds the static bundle but does not replace normal type checking and dependency repair.

Terminal window
git fetch origin
git pull --ff-only origin main
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"
Set-Location <repo-root>\frontend
npm install --no-audit --no-fund
npm run build

After the build, hard refresh the browser. If a service worker keeps serving an old bundle, unregister it in DevTools and refresh again.

Symptom Likely cause First action
UI is stale after pulling code Existing frontend/dist was served without rebuilding Run npm run build, then hard refresh.
SELF_SIGNED_CERT_IN_CHAIN npm does not trust the corporate root CA Set NODE_EXTRA_CA_CERTS to a PEM bundle and retry.
Exit handler never called! npm failed during registry or audit work Use npm install --no-audit --no-fund after fixing certificate trust.
vite or vue-tsc is not recognized .bin shims are missing after a partial install Run npm install --no-audit --no-fund.
Build cannot resolve a package that exists as an empty directory node_modules is partially installed Repair dependencies with npm install.