Summary
The global-variables plugin merged in PR #743 has its code in packages/core/src/plugins/core-plugins/global-variables-plugin/ but the routes (/api/global-variables, /admin/global-variables) are never actually mounted into the running Hono app. Enabling the plugin from the admin Plugins page has no effect — the endpoints return 404.
Expected Behavior
After activating the Global Variables plugin from /admin/plugins:
GET /api/global-variables should return the variables list
GET /admin/global-variables should render the admin page
- The sidebar should show a "Global Variables" menu item
Actual Behavior
- All routes return 404
- No menu item appears in the sidebar
- The plugin shows as "active" in the plugins table but has no runtime effect
Root Cause
The PluginBuilder.addRoute() method stores route metadata on the plugin object, but there is no bootstrap step that iterates over active plugins and mounts their Hono route handlers into the main app. The plugin effectively exists as dead code after the merge.
This appears to affect any plugin that relies solely on PluginBuilder.addRoute() for route registration — the metadata is recorded but never acted upon by the plugin manager or app factory.
Steps to Reproduce
- Fresh
npm install && npm run dev
- Go to
/admin/plugins
- Activate "Global Variables"
- Navigate to
/admin/global-variables → 404
GET /api/global-variables → 404
Workaround
Mount the routes manually in the app's index.ts using the exported Hono route handlers:
import { globalVariablesApiRoutes, globalVariablesAdminRoutes } from './plugins/global-variables-plugin'
// Mount manually after createSonicJSApp()
app.route('/api/global-variables', globalVariablesApiRoutes)
app.route('/admin/global-variables', globalVariablesAdminRoutes)
This is what we did in our implementation (see PR #757 for the full working integration).
Related
Summary
The global-variables plugin merged in PR #743 has its code in
packages/core/src/plugins/core-plugins/global-variables-plugin/but the routes (/api/global-variables,/admin/global-variables) are never actually mounted into the running Hono app. Enabling the plugin from the admin Plugins page has no effect — the endpoints return 404.Expected Behavior
After activating the Global Variables plugin from
/admin/plugins:GET /api/global-variablesshould return the variables listGET /admin/global-variablesshould render the admin pageActual Behavior
Root Cause
The
PluginBuilder.addRoute()method stores route metadata on the plugin object, but there is no bootstrap step that iterates over active plugins and mounts their Hono route handlers into the main app. The plugin effectively exists as dead code after the merge.This appears to affect any plugin that relies solely on
PluginBuilder.addRoute()for route registration — the metadata is recorded but never acted upon by the plugin manager or app factory.Steps to Reproduce
npm install && npm run dev/admin/plugins/admin/global-variables→ 404GET /api/global-variables→ 404Workaround
Mount the routes manually in the app's
index.tsusing the exported Hono route handlers:This is what we did in our implementation (see PR #757 for the full working integration).
Related