deerflow2/frontend/tests/unit/core
Xinmin Zeng aded753de3
fix(frontend): restore localhost fallback for getGatewayConfig in prod mode (#2705) (#2718)
* fix(frontend): unify gateway-config localhost fallback for prod (#2705)

`getGatewayConfig()` only fell back to localhost defaults when
`NODE_ENV === "development"`, while `next.config.js` always falls back
to `127.0.0.1:8001`. Running `make start` (which sets NODE_ENV=production
via `next start`) without `DEER_FLOW_INTERNAL_GATEWAY_BASE_URL` /
`DEER_FLOW_TRUSTED_ORIGINS` therefore caused zod to throw inside SSR
layouts and surfaced as a 500.

Drop the NODE_ENV gating and use localhost defaults everywhere — the
"force explicit config in prod" intent should be enforced by deployment
templates (docker-compose already sets both vars), not by request-time
crashes. Document the two vars in both .env.example files and add unit
coverage for the dev/prod env-unset paths.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update internalGatewayUrl in gateway config tests

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-05 16:27:29 +08:00
..
api feat(frontend): set up Vitest frontend testing infrastructure with CI workflow (#2147) 2026-04-12 18:00:43 +08:00
auth fix(frontend): restore localhost fallback for getGatewayConfig in prod mode (#2705) (#2718) 2026-05-05 16:27:29 +08:00
messages feat: refine token usage display modes (#2329) 2026-05-04 09:56:16 +08:00
streamdown fix(reasoning): prevent LLM-hallucinated HTML tags from rendering as DOM elements (#2321) 2026-04-19 19:27:34 +08:00
threads feat(frontend): set up Vitest frontend testing infrastructure with CI workflow (#2147) 2026-04-12 18:00:43 +08:00
uploads feat(frontend): set up Vitest frontend testing infrastructure with CI workflow (#2147) 2026-04-12 18:00:43 +08:00
reasoning-trigger.test.ts Fix invalid HTML nesting in reasoning trigger during complex task rendering (#2382) 2026-04-21 09:41:28 +08:00