Skip to content

deploy_component without restart: TypeError instead of actionable error when accessing new component URL #674

Description

@kriszyp

When a component is deployed via deploy_component but Harper has not yet been restarted, the component's routes are not registered. Accessing a URL in that component then throws a server-side TypeError: rg.getMatch is not a function rather than a meaningful response.

Reproduction

  1. deploy_component a new component without restarting Harper.
  2. Navigate to the component's URL (e.g. /prometheus_exporter/metrics).
  3. Expected: 404 or a clear message: "Component deployed but requires a restart to activate."
  4. Actual: Unhandled TypeError: rg.getMatch is not a function

Fix

Catch the missing-route case (pre-restart component) in the request handler and return an informative response rather than throwing. Options:

  • Return HTTP 404 with a JSON body { "error": "Component 'X' is deployed but Harper must be restarted before its routes are active." }
  • Or: automatically trigger a restart on successful deploy_component (separate discussion).

🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Labels

area:componentsComponents / applications subsystembugSomething isn't workingfrom-jiraMigrated or originated from a Jira ticket

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions