{"record":{"id":"9627cd4c1158e01b","repo":"Molunerfinn/PicGo","slug":"failed-to-refresh-plugin-config-schema","errorCode":null,"errorMessage":"Failed to refresh plugin config schema","messagePattern":"Failed to refresh plugin config schema","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/adapters/plugins.ts","lineNumber":88,"sourceCode":"  },\n  uninstallPlugin (fullName: string) {\n    return invokeRPC<string>(IRPCActionType.UNINSTALL_PLUGIN, fullName)\n  },\n  updatePlugin (fullName: string) {\n    return invokeRPC<string>(IRPCActionType.UPDATE_PLUGIN, fullName)\n  },\n  togglePluginEnabled (fullName: string, enabled: boolean) {\n    return invokeRPC<string>(\n      enabled\n        ? IRPCActionType.ENABLE_PLUGIN\n        : IRPCActionType.DISABLE_PLUGIN,\n      fullName\n    )\n  },\n  async refreshConfigSchema (payload: IRefreshConfigSchemaArgs): Promise<ProviderPluginConfig[]> {\n    const result = await invokeRPC<unknown[]>(IRPCActionType.REFRESH_CONFIG_SCHEMA, payload)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to refresh plugin config schema')\n    }\n    return normalizePluginConfigSchema(result.data)\n  },\n  async saveTransformer (transformer: string) {\n    await saveConfig({\n      'picBed.transformer': transformer\n    })\n  },\n  async fetchPluginReadme (fullName: string, options?: { installed?: boolean }) {\n    // For installed plugins (including locally imported ones not on npm),\n    // read README from disk via the main process — jsdelivr 404s on\n    // unpublished plugins. Non-installed plugins (e.g. search results) fall\n    // back to the CDN.\n    if (options?.installed) {\n      const result = await invokeRPC<string>(\n        IRPCActionType.GET_INSTALLED_PLUGIN_README,\n        fullName\n      )","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/adapters/plugins.ts#L70-L106","documentation":"refreshConfigSchema invokes the REFRESH_CONFIG_SCHEMA RPC and expects a success envelope. When result.success is false it throws with result.error, defaulting to 'Failed to refresh plugin config schema'. This means the main process could not rebuild the plugin's config form schema (plugin reload failed, plugin crashed, or the main-side handler reported an error).","triggerScenarios":"Calling refreshConfigSchema (via fetchSchema/resolvedSchema) after a plugin update/reload where the plugin's config method throws or is missing, or when the RPC handler itself fails and returns success:false with an empty error string.","commonSituations":"Plugin upgraded to a version whose config() signature changed; plugin not built correctly (missing dist); Node module resolution failure in the main process; plugin hangs or throws during config generation.","solutions":["Read result.error from the RPC response/logs for the underlying cause (the thrown message may contain it)","Reload or reinstall the plugin so its config schema generation succeeds","Check the plugin's dist output and config() export after an update","Restart the app to reset the plugin host if the plugin is wedged"],"exampleFix":"// before\nconst schema = await refreshConfigSchema({ fullName }) // throws on success:false\n// after\ntry {\n  const schema = await refreshConfigSchema({ fullName })\n} catch (e) {\n  await reloadPlugin(fullName)\n  const schema = await refreshConfigSchema({ fullName })\n}","handlingStrategy":"try-catch","validationCode":"const installed = await getInstalledPluginList()\nif (!installed.some(p => p.fullName === payload.fullName)) {\n  throw new Error('Plugin not installed: ' + payload.fullName)\n}","typeGuard":"function rpcOk(result) {\n  return !!result && result.success === true && Array.isArray(result.data)\n}","tryCatchPattern":"try {\n  return await refreshConfigSchema(payload)\n} catch (e) {\n  logger.warn('schema refresh failed', e)\n  await reloadPlugin(payload.fullName)\n  return await refreshConfigSchema(payload)\n}","preventionTips":["Reload plugins after upgrades before requesting schemas","Verify the plugin builds and exposes config() after version bumps","Check main-process logs for the underlying error in result.error","Surface a reload/reinstall action in the plugin settings UI"],"tags":["plugin","rpc","schema","renderer"],"backgroundTag":"plugin-config-schema-refresh-failed","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}