Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / devSurfacesEnabled

Function: devSurfacesEnabled()

devSurfacesEnabled(): boolean

Defined in: support/env.ts:68

Whether this process may expose dev-only surfaces — the stack-trace error page, the trace inspector, an open monitor panel.

Two things qualify a process, and both are needed because they answer different questions:

  • serve --dev supervises this process. The orchestrator only ever runs from a developer's terminal (it watches the filesystem and rebundles assets — nothing a deployment does), so its worker is a dev machine by construction. This is the case that carries dev mode, because APP_ENV cannot: setAppEnv() overwrites it with a runtime mode (web, worker, console) before the app boots, so by the time any gate reads it, whatever deployment name the developer configured is gone.

  • APP_ENV still names an explicitly non-production environment. This covers processes started outside the CLI — the test harness, and any embedder that sets APP_ENV itself rather than through setAppEnv().

Anything else fails closed, so a production deploy that sets no APP_ENV exposes nothing.

Returns

boolean