Molunerfinn/PicGo · error

Transformer not found

Error message

Transformer not found

What it means

togglePluginTransformer toggles a plugin's transformer in appConfig.picBed.transformer, but only if the installed plugin declares a transformer in its config. The error is thrown when the plugin cannot be found in the pluginsInstalled store by fullName, or when it exists but its config.transformer.name is empty/undefined. It is a guard against mutating transformer settings for a plugin that has no transformer to activate.

Source

Thrown at src/renderer/store/plugins/actions.ts:300

      await pluginsAdapter.savePluginConfig(
        section === 'config' ? 'plugin' : 'transformer',
        targetConfigName,
        values as IStringKeyMap
      )
      await appActions.refreshAppConfig()
      const installedPlugins = await pluginsAdapter.getInstalledPlugins()
      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))
    } finally {
      pluginStoreActions.setMutating(fullName, false)
    }
  },
  async togglePluginTransformer (fullName: string) {
    const installedPlugin = useAppStore.getState().pluginsInstalled.find(
      (item) => item.fullName === fullName
    )

    if (!installedPlugin?.config.transformer.name) {
      throw new Error('Transformer not found')
    }

    const transformerName = installedPlugin.config.transformer.name
    const currentTransformer =
      useAppStore.getState().appConfig?.picBed.transformer ?? 'path'
    const nextTransformer =
      currentTransformer === transformerName ? 'path' : transformerName

    await pluginsAdapter.saveTransformer(nextTransformer)
    await pluginsAdapter.setNeedReload(true)
    await appActions.refreshAppConfig()
    await appActions.hydrateAppState()

    return nextTransformer
  },
  async runPluginGuiMenuAction (fullName: string, label: string) {
    return {
      fullName,

View on GitHub (pinned to 07ec7068a5)

Solutions

  1. Look up the plugin in pluginsInstalled by fullName first and bail out (or show a message) if it is missing.
  2. Check installedPlugin.config.transformer.name is a non-empty string before toggling; if absent, the plugin has no transformer and the toggle is not applicable.
  3. Ensure pluginsInstalled is hydrated (plugins loaded from main process) before invoking the action.
  4. Pass the exact fullName string (e.g. 'picgo-plugin-xxx'), not a display name or short name.

Example fix

// before
await pluginStoreActions.togglePluginTransformer(fullName)

// after
const plugin = useAppStore.getState().pluginsInstalled.find(
  (item) => item.fullName === fullName
)
if (!plugin?.config.transformer.name) {
  toast.warning(i18n.t('PLUGIN_NO_TRANSFORMER'))
  return
}
await pluginStoreActions.togglePluginTransformer(fullName)
Defensive patterns

Strategy: validation

Validate before calling

const plugin = useAppStore.getState().pluginsInstalled.find(
  (item) => item.fullName === fullName
)
if (!plugin?.config.transformer.name) {
  // skip toggle: plugin missing or has no transformer
  return
}

Type guard

function hasTransformer(
  plugin: InstalledPlugin | undefined
): plugin is InstalledPlugin & {
  config: { transformer: { name: string } }
} {
  return typeof plugin?.config.transformer.name === 'string' &&
    plugin.config.transformer.name.length > 0
}

Try / catch

try {
  await pluginStoreActions.togglePluginTransformer(fullName)
} catch (err) {
  if ((err as Error).message === 'Transformer not found') {
    toast.warning(i18n.t('PLUGIN_NO_TRANSFORMER'))
  }
}

Prevention

When it happens

Trigger: Calling pluginStoreActions.togglePluginTransformer(fullName) with a fullName that is not in useAppStore's pluginsInstalled list, or with a plugin whose config.transformer.name is undefined (e.g. a plugin that registers no transformer, or a plugin record whose config was never hydrated).

Common situations: Stale fullName after the plugin was uninstalled or renamed; a plugin that only registers uploaders/transformers optionally; calling the toggle from UI code before pluginsInstalled finishes loading; passing a plugin name instead of its fullName.

Related errors


AI-assisted analysis of Molunerfinn/PicGo@07ec7068a5 (2026-08-30). Data as JSON: /api/errors/52c40cec5ff89c5b. Report an issue: GitHub.