fix: update wrangler.jsonc and deployment instructions

- Move route and vars to top level in wrangler.jsonc (remove env.production wrapper)
- Update deployment instructions: use 'npx wrangler deploy' without --env flags
- Update all documentation (README.md, .cursorrules, CLAUDE.md) to reflect correct deployment process
- Route configured as agents.nicholai.work at top level
This commit is contained in:
Nicholai 2025-11-15 07:34:06 -07:00
parent 4ef7d55530
commit c2185713a6
4 changed files with 19 additions and 22 deletions

View File

@ -326,7 +326,7 @@ npx @opennextjs/cloudflare build
npx wrangler deploy
```
Update `wrangler.jsonc` with new env vars in `vars` section.
**Important:** Always use `npx wrangler deploy` without any `--env` flags. The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`. Update `wrangler.jsonc` with new env vars in the top-level `vars` section.
## Debugging Tips

View File

@ -22,11 +22,12 @@ pnpm test:coverage # Generate test coverage report
```bash
npx @opennextjs/cloudflare build # Convert Next.js build to Cloudflare Workers format
npx wrangler deploy # Deploy to Cloudflare (requires OpenNext build first)
npx wrangler deploy --env="" # Deploy to default environment explicitly
npx wrangler tail # View live logs from deployed worker
```
**Critical**: Always run `npx @opennextjs/cloudflare build` before deploying. The standard `next build` alone is insufficient for Cloudflare deployment.
**Critical**:
- Always run `npx @opennextjs/cloudflare build` before deploying. The standard `next build` alone is insufficient for Cloudflare deployment.
- Always use `npx wrangler deploy` without any `--env` flags. The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`.
## Architecture
@ -111,8 +112,10 @@ The route handles multiple n8n response formats:
### wrangler.jsonc
- Worker entry: `.open-next/worker.js` (generated by OpenNext)
- Assets directory: `.open-next/assets`
- Production route: `agents.nicholai.work`
- Route: `agents.nicholai.work` (configured at top level, not in env section)
- Environment variables: Configured in top-level `vars` section
- Compatibility flags: `nodejs_compat`, `global_fetch_strictly_public`
- **Important:** Deployment uses default configuration - do not use `--env` flags
### Build Output
- Standard Next.js build: `.next/`

View File

@ -218,10 +218,7 @@ Deploy to Cloudflare Workers:
npx wrangler deploy
```
Or for specific environment:
```bash
npx wrangler deploy --env production
```
**Note:** The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`. Do not use `--env` flags.
3. **View logs**
```bash

View File

@ -12,8 +12,6 @@
"nodejs_compat",
"global_fetch_strictly_public"
],
"env": {
"production": {
"route": "agents.nicholai.work",
"vars": {
"AGENT_1_URL": "https://n8n.biohazardvfx.com/webhook/d2ab4653-a107-412c-a905-ccd80e5b76cd",
@ -22,10 +20,9 @@
"AGENT_2_URL": "https://n8n.biohazardvfx.com/webhook/0884bd10-256d-441c-971c-b9f1c8506fdf",
"AGENT_2_NAME": "Morgan",
"AGENT_2_DESCRIPTION": "System Prompt Designer",
"CUSTOM_AGENT_WEBHOOK": "https://n8n.biohazardvfx.com/webhook-test/7cbdc539-526f-425f-abea-0886ec4c1e76",
"IMAGE_UPLOADS_ENABLED": "true",
"DIFF_TOOL_ENABLED": "true"
}
}
},
"assets": {
"binding": "ASSETS",