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
deploy_component a new component without restarting Harper.
- Navigate to the component's URL (e.g.
/prometheus_exporter/metrics).
- Expected: 404 or a clear message: "Component deployed but requires a restart to activate."
- 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.
When a component is deployed via
deploy_componentbut Harper has not yet been restarted, the component's routes are not registered. Accessing a URL in that component then throws a server-sideTypeError: rg.getMatch is not a functionrather than a meaningful response.Reproduction
deploy_componenta new component without restarting Harper./prometheus_exporter/metrics).TypeError: rg.getMatch is not a functionFix
Catch the missing-route case (pre-restart component) in the request handler and return an informative response rather than throwing. Options:
{ "error": "Component 'X' is deployed but Harper must be restarted before its routes are active." }deploy_component(separate discussion).🤖 Filed by Claude on behalf of Kris.