{"record":{"id":"1859241ccc04f8f2","repo":"Molunerfinn/PicGo","slug":"imported-plugin-not-found","errorCode":null,"errorMessage":"Imported plugin not found","messagePattern":"Imported plugin not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/store/plugins/actions.ts","lineNumber":403,"sourceCode":"    try {\n      const result = await pluginsAdapter.importLocalPlugin()\n      if (!result.success) {\n        throw new Error(result.error || 'Import local plugin failed')\n      }\n\n      if (!result.data) {\n        return null\n      }\n\n      await appActions.hydrateAppState()\n      const installedPlugins = await pluginsAdapter.getInstalledPlugins()\n      pluginStoreActions.setInstalledPlugins(installedPlugins.map(mapInstalledPluginItem))\n      const installedPlugin = useAppStore.getState().pluginsInstalled.find(\n        (item) => item.fullName === result.data || item.name === result.data\n      )\n\n      if (!installedPlugin) {\n        throw new Error('Imported plugin not found')\n      }\n\n      toast.success(i18n.t('PLUGIN_IMPORT_SUCCEED'))\n      return {\n        path: result.data,\n        installedPlugin\n      }\n    } finally {\n      pluginStoreActions.setImportingLocal(false)\n    }\n  }\n}\n","sourceCodeStart":385,"sourceCodeEnd":416,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/store/plugins/actions.ts#L385-L416","documentation":"After the main process reports a successful local plugin import, importLocalPlugin refreshes the installed plugin list and searches for the imported plugin by fullName OR short name. This error is thrown when the import succeeded at the IPC level but the plugin never appears in the refreshed pluginsInstalled list, i.e. the plugin is on disk but not registered as installed.","triggerScenarios":"The adapter resolves with success:true and data set to the plugin path, but after mapInstalledPluginItem over the refreshed list, no item matches item.fullName === result.data or item.name === result.data — e.g. the main process installed the package but plugin discovery/registration skipped it.","commonSituations":"Plugin installed under a directory name that does not match its package name; plugin registered under a scoped name (e.g. @scope/picgo-plugin-x) so neither fullName nor name equals the path; app state hydration raced ahead of the install completion.","solutions":["Re-hydrate the installed plugin list and retry the lookup by both fullName and name before giving up.","Confirm the plugin's package name matches the folder/identifier returned by the import adapter.","Check main-process plugin registration logs to see why the imported package was not added to the installed list.","Manually restart plugin refresh (reload app state) and verify the plugin shows up in settings before using it."],"exampleFix":"// before\nconst imported = await pluginStoreActions.importLocalPlugin()\nconst plugin = imported?.installedPlugin\n\n// after\ntry {\n  const imported = await pluginStoreActions.importLocalPlugin()\n} catch (err) {\n  if ((err as Error).message === 'Imported plugin not found') {\n    await appActions.hydrateAppState()\n    toast.warning(i18n.t('PLUGIN_IMPORT_VERIFY_FAILED'))\n    return\n  }\n  throw err\n}","handlingStrategy":"validation","validationCode":"await appActions.hydrateAppState()\nconst found = useAppStore.getState().pluginsInstalled.find(\n  (item) => item.fullName === result.data || item.name === result.data\n)\nif (!found) {\n  // treat as failed import: plugin on disk but not registered\n  return null\n}","typeGuard":"function isRegistered(\n  plugin: InstalledPlugin | undefined,\n  identifier: string\n): plugin is InstalledPlugin {\n  return !!plugin &&\n    (plugin.fullName === identifier || plugin.name === identifier)\n}","tryCatchPattern":"try {\n  const imported = await pluginStoreActions.importLocalPlugin()\n} catch (err) {\n  if ((err as Error).message === 'Imported plugin not found') {\n    await appActions.hydrateAppState() // resync then retry lookup\n  }\n}","preventionTips":["Ensure the imported package name matches its directory/identifier.","Re-hydrate plugin state after any install/import before consuming it.","Log main-process registration results to catch silently skipped plugins."],"tags":["plugin","import","state-store","sync"],"backgroundTag":"plugin-not-found-after-import","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}