loadVexConfigModule
loadVexConfigModule<
TConfig>(props):Promise<VexConfigModuleResult<TConfig>>
Defined in: packages/core/src/config/loadVexConfigModule.ts:25
Loads a config module through a dynamic import and turns anything it throws while evaluating —
defineConfig, defineServerConfig, defineCollection, a field builder, or a plain runtime
error — into a result the caller can render instead of a crashed route.
Config errors are thrown at module evaluation, so a static import config from "~/vex.config"
fails before any component renders and no error boundary can catch it. Call this from a server
component (root layout, admin page) with () => import("~/vex.config"). The full error is
logged with console.error; the returned summary carries the message only when includeDetail
is true.
Type Parameters
Section titled “Type Parameters”TConfig
Section titled “TConfig”TConfig
Parameters
Section titled “Parameters”includeDetail?
Section titled “includeDetail?”boolean
Include the error’s name and message in the summary. Defaults to
process.env.NODE_ENV === "development".
() => Promise<{ default: TConfig; }>
Imports the config module, e.g. () => import("~/vex.config.server").
Returns
Section titled “Returns”Promise<VexConfigModuleResult<TConfig>>
{ status: "loaded", config } with the module’s default export, or
{ status: "invalid", error }.