# Operational Notes (B0)

## 1. @tabler/icons-react ESM workaround

**Symptom**: `npm install` in `vibecoder-standalone/` fails on `@blocknote/mantine` peer dep
which transitively requires `@tabler/icons-react`. The ESM resolution path breaks in
Vite 5.x when the consumer uses CJS contexts.

**Workaround (per B0, document for v5.0 B13 chrome-unity work)**:

```js
// vite.config.ts in vibecoder-standalone/
import { defineConfig } from 'vite';
import { resolve } from 'path';

export default defineConfig({
  resolve: {
    alias: {
      '@tabler/icons-react': resolve(__dirname, 'node_modules/@tabler/icons-react/dist/cjs/index.cjs')
    },
    dedupe: ['@tabler/icons-react', 'react', 'react-dom']
  },
  optimizeDeps: {
    include: ['@tabler/icons-react']
  }
});
```

**Why this works**: forces Vite to use the CJS bundle of @tabler/icons-react
(which is bundled and self-contained), bypassing the ESM/CJS interop issue.
The `optimizeDeps.include` pre-bundles it so the dev server doesn't re-resolve
on every HMR.

**Source**: pre-existing in `vibecoder-standalone/vite.config.ts` (verified by `git log --all -S "@tabler/icons-react"`).

## 2. Caddy allowlist for new subdomains

**Symptom**: brand-new subdomains (e.g. `fvre-10-b1-oscar-chrome-20260814.freshvibeapps.com`)
return 404 on first deploy until the operator-panel restart picks up the
Caddy config change.

**Workaround (operational, not code)**:

1. After merge to main, the deploy script pushes a new subdomain entry.
2. Caddy needs to be reloaded to pick up the new entry.
3. The reload is automatic IF the operator-panel is running. If not:
   - `systemctl restart caddy` (or equivalent)
   - Or: `docker restart caddy` (if Caddy is in a container)

**Document for B0** (DC-B0-9 follow-up):

```bash
# Add to operator-panel mavis' operational scripts:
# /root/scripts/caddy-reload-on-new-subdomain.sh

#!/bin/bash
set -e
NEW_SUBDOMAIN="${1:?usage: $0 subdomain.freshvibeapps.com}"
if ! caddy validate --config /etc/caddy/Caddyfile 2>/dev/null; then
  echo "❌ Caddy config invalid; manual review needed"
  exit 1
fi
systemctl reload caddy
echo "✅ Caddy reloaded for ${NEW_SUBDOMAIN}"
```

**Source**: known limitation per operator audit (b1241, b1243 follow-ups).
