GUIDE 18 / 28 · NATIVE 2.0.7

Debugging plugins

Find loader, hook, action, settings and UI failures with a repeatable local test sequence.

Start with the two log surfaces#

The Plugins console receives manager log events and keeps the newest 200 entries in memory. The host also writes service stderr to %APPDATA%\Hydro Clips\native.log, including routed console messages, compilation errors and unhandled asynchronous errors.

Use context.log(message, 'error') for failures and concise success messages for checkpoints. Include an action ID or clip ID rather than an entire config object. After reload, confirm that the expected plugin version appears before testing behavior.

Symptom to cause#

SymptomCheck first
Plugin does not appearFolder nesting, valid plugin.json, entry file existence and unique ID.
Manifest appears but hooks do nothingEnabled state, compilation log and module.exports assignment.
Async init fails silently in the UIonInit promise is not awaited; attach catch and inspect native.log.
Counter increases twice after editsOld recurring timers may survive reload; remove intervals and restart.
Settings value stays emptySchema placeholder is not runtime config; provide fallback and explicit config defaults.
Tab is blankRegister the tab before setTabContent and match openTabId to its ID.
Action reports success but nothing changesThere may be no action handler; log the handler entry explicitly.

Run a small verification sequence#

  1. Load only the example under test and inspect the initialization log.
  2. Invoke its native action button once and verify its returned state.
  3. Save a short manual clip; confirm one onClipSaved call.
  4. Save a replay; verify type instant_replay.
  5. Take a screenshot; verify the separate onScreenshot path.
  6. Change one setting and inspect the normalized value.
  7. Reload once, then restart once, and check persistence and duplicate work.

Test against a temporary plugin data folder or with a copy of your plugin-owned data. Do not point debugging examples at personal webhooks unless you intend to send their payloads.

When saving becomes slow#

Temporarily disable optional plugins in the UI and compare export time for a similar short clip. If timing improves, check awaited hooks for network requests, large synchronous reads or an onRecordingStop task. Native recording commands are serialized, so one delayed hook can hold later exports.

An error in one dispatched hook is logged and the dispatcher proceeds, but a promise that never settles can keep that step pending. Use short event handlers and explicit time limits. See native performance to separate encoding, finalization and plugin time.

Implementation reference: PluginManager hook dispatchers; src/native/recorder.ts · native 2.0.7.