{"record":{"id":"52c40cec5ff89c5b","repo":"Molunerfinn/PicGo","slug":"transformer-not-found","errorCode":null,"errorMessage":"Transformer not found","messagePattern":"Transformer not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/store/plugins/actions.ts","lineNumber":300,"sourceCode":"      await pluginsAdapter.savePluginConfig(\n        section === 'config' ? 'plugin' : 'transformer',\n        targetConfigName,\n        values as IStringKeyMap\n      )\n      await appActions.refreshAppConfig()\n      const installedPlugins = await pluginsAdapter.getInstalledPlugins()\n      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))\n    } finally {\n      pluginStoreActions.setMutating(fullName, false)\n    }\n  },\n  async togglePluginTransformer (fullName: string) {\n    const installedPlugin = useAppStore.getState().pluginsInstalled.find(\n      (item) => item.fullName === fullName\n    )\n\n    if (!installedPlugin?.config.transformer.name) {\n      throw new Error('Transformer not found')\n    }\n\n    const transformerName = installedPlugin.config.transformer.name\n    const currentTransformer =\n      useAppStore.getState().appConfig?.picBed.transformer ?? 'path'\n    const nextTransformer =\n      currentTransformer === transformerName ? 'path' : transformerName\n\n    await pluginsAdapter.saveTransformer(nextTransformer)\n    await pluginsAdapter.setNeedReload(true)\n    await appActions.refreshAppConfig()\n    await appActions.hydrateAppState()\n\n    return nextTransformer\n  },\n  async runPluginGuiMenuAction (fullName: string, label: string) {\n    return {\n      fullName,","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/store/plugins/actions.ts#L282-L318","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Look up the plugin in pluginsInstalled by fullName first and bail out (or show a message) if it is missing.","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.","Ensure pluginsInstalled is hydrated (plugins loaded from main process) before invoking the action.","Pass the exact fullName string (e.g. 'picgo-plugin-xxx'), not a display name or short name."],"exampleFix":"// before\nawait pluginStoreActions.togglePluginTransformer(fullName)\n\n// after\nconst plugin = useAppStore.getState().pluginsInstalled.find(\n  (item) => item.fullName === fullName\n)\nif (!plugin?.config.transformer.name) {\n  toast.warning(i18n.t('PLUGIN_NO_TRANSFORMER'))\n  return\n}\nawait pluginStoreActions.togglePluginTransformer(fullName)","handlingStrategy":"validation","validationCode":"const plugin = useAppStore.getState().pluginsInstalled.find(\n  (item) => item.fullName === fullName\n)\nif (!plugin?.config.transformer.name) {\n  // skip toggle: plugin missing or has no transformer\n  return\n}","typeGuard":"function hasTransformer(\n  plugin: InstalledPlugin | undefined\n): plugin is InstalledPlugin & {\n  config: { transformer: { name: string } }\n} {\n  return typeof plugin?.config.transformer.name === 'string' &&\n    plugin.config.transformer.name.length > 0\n}","tryCatchPattern":"try {\n  await pluginStoreActions.togglePluginTransformer(fullName)\n} catch (err) {\n  if ((err as Error).message === 'Transformer not found') {\n    toast.warning(i18n.t('PLUGIN_NO_TRANSFORMER'))\n  }\n}","preventionTips":["Always resolve fullName from the pluginsInstalled list, never from user-typed strings.","Render the transformer toggle in the UI only when config.transformer.name exists.","Gate plugin actions behind a loaded/hydrated pluginsInstalled flag."],"tags":["plugin","transformer","zustand","state-store","validation"],"backgroundTag":"plugin-transformer-not-found","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}