Hidden Assumptions in vendure

13 assumptions this code never checks · 5 critical · spanning Environment, Shape, Temporal, Resource, Contract, Scale, Domain

Every codebase relies on things it never checks. Most of them are routine. CodeSea looked at vendurehq/vendure and picked out the few most likely to cause trouble. The full list is just below.

Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".

Worth your attention first

If the config endpoint is unavailable, returns malformed JSON, or has wrong schema, the admin UI fails to bootstrap with only a console.log error, leaving users with a blank page and no actionable error message

Worth your attention first

Invalid metric types are silently skipped in the loop, returning incomplete metrics data without warning - users receive partial results believing they got complete metrics

Worth your attention first

For large stores with millions of orders, attempting to load all orders at once causes out-of-memory errors or database timeout failures during metrics calculation

Show everything (10 more)
Temporal

endOfDay(new Date()) creates cache keys assuming consistent timezone across all servers and that system clock is synchronized for cache hits

If this fails: In multi-server deployments with different timezones or clock skew, identical metric requests generate different cache keys, causing cache misses and unnecessary recalculation of expensive metrics

packages/asset-server-plugin/src/service/metrics.service.ts:getMetrics
Contract

registerCommands expects cliCommands array to contain valid Commander.js command definitions with proper structure (name, description, action functions)

If this fails: Malformed command definitions cause the CLI to crash during registration phase with cryptic Commander.js errors, making the entire CLI unusable until commands are fixed

packages/cli/src/cli.ts:registerCommands
Environment

vendureDashboardPlugin expects the Vendure API at 'https://demo.vendure.io:443' to be accessible and respond with valid GraphQL schema during Storybook build

If this fails: If the demo API is down or returns invalid responses, Storybook build fails completely, preventing any local development or documentation generation for the dashboard components

packages/dashboard/.storybook/main.ts:vendureDashboardPlugin
Scale

defineDashboardExtension assumes route paths like '/form-inputs-test' are globally unique across all loaded dashboard extensions without collision detection

If this fails: Multiple extensions defining the same route path results in unpredictable routing behavior where only one extension's component loads, potentially breaking critical admin functionality

packages/dashboard/e2e/fixtures/form-inputs-test-dashboard/index.tsx:defineDashboardExtension
Environment

RUN_JOB_QUEUE environment variable, when set to '1', assumes JobQueueService is properly configured and all required queue backends are available

If this fails: If job queue backend (Redis, database) is unavailable but RUN_JOB_QUEUE=1, the server starts successfully but jobs silently fail to process, leaving orders unprocessed and emails unsent

packages/dev-server/index.ts:process.env.RUN_JOB_QUEUE
Shape

EmailEventHandler.loadData() callback is expected to return data that matches the generic type R, but there's no runtime validation of the returned data structure

If this fails: If loadData returns incompatible data types (wrong shape, missing properties), email template rendering fails silently or produces incorrect emails using undefined template variables

packages/email-plugin/src/types.ts:EventWithAsyncData
Temporal

GlobalTemplateVarsFn async function assumes RequestContext and Injector remain valid throughout the async execution and that injector.get() calls don't fail

If this fails: If RequestContext expires or services are not properly registered during template rendering, email generation fails with dependency injection errors, blocking all email sending

packages/email-plugin/src/types.ts:GlobalTemplateVarsFn
Domain

GraphQL schema extension assumes Campaign entity always has a valid promotion relationship and that promotionId foreign key constraints are maintained

If this fails: If promotionId references deleted promotions or database constraints are not enforced, GraphQL queries for campaigns return null promotion data without indicating the referential integrity violation

packages/core/e2e/fixtures/test-plugins/issue-2453/api/index.ts:apiExtensions
Contract

ImageTransformPreset width and height are expected to be positive integers representing pixels, with no validation of reasonable size limits

If this fails: Extremely large dimensions (width: 50000, height: 50000) cause Sharp image processing to consume excessive memory and crash the server when users request preset transformations

packages/asset-server-plugin/src/types.ts:ImageTransformPreset
Resource

CacheConfig maxAge assumes clients and CDNs properly respect Cache-Control headers and that the asset content doesn't change during the cache lifetime

If this fails: If assets are overwritten with same filename but different content during cache period, users receive stale cached versions leading to incorrect product images or broken layouts

packages/asset-server-plugin/src/types.ts:CacheConfig

See the full structural analysis of vendure: the pipeline, data models, and system behavior that put these assumptions in context.

Full analysis of vendurehq/vendure →

Frequently Asked Questions

What does vendure assume that could break in production?

The one most likely to cause trouble: loadAppConfig() function expects admin UI config to be available at a default endpoint (typically /admin-api/app-config) and returns valid configuration data without validation If this fails, If the config endpoint is unavailable, returns malformed JSON, or has wrong schema, the admin UI fails to bootstrap with only a console.log error, leaving users with a blank page and no actionable error message

How many hidden assumptions does vendure have?

CodeSea found 13 assumptions vendure relies on but never validates, 5 of them critical, spanning Environment, Shape, Temporal, Resource, Contract, Scale, Domain. Most are routine — the analysis flags the two or three most likely to actually bite.

What is a hidden assumption?

Something the code depends on but never checks: a data shape, an ordering, an environment condition, a scale limit, or a contract with another service. It holds until the world it runs in changes, then fails silently.