Molunerfinn/PicGo · error · Error

Config not found

Error message

Config not found

What it means

getConfigNameById resolves a provider config's display name (_configName) from its id. It throws the localized TIPS_UPLOADER_CONFIG_NOT_FOUND error when getConfigItemById returns nothing, i.e. no config with that id exists under the given providerId. Callers use it to derive configName/sourceConfigName for rename/copy flows.

Source

Thrown at src/renderer/store/providers/actions.ts:42

  }
}

function getConfigState (providerId: string) {
  return useAppStore.getState().appConfig?.uploader?.[providerId]
}

function getConfigItemById (
  providerId: string,
  configId: string
): ProviderUploaderConfigItem | null {
  return getConfigState(providerId)?.configList.find((item) => item._id === configId) ?? null
}

function getConfigNameById (providerId: string, configId: string) {
  const configItem = getConfigItemById(providerId, configId)

  if (!configItem) {
    throw new Error(i18n.t('TIPS_UPLOADER_CONFIG_NOT_FOUND'))
  }

  return configItem._configName
}

async function runWithProviderLoading<T> (
  providerId: string,
  task: () => Promise<T>
) {
  providerStoreActions.setLoadingByProvider(providerId, true)

  try {
    return await task()
  } finally {
    providerStoreActions.setLoadingByProvider(providerId, false)
  }
}

View on GitHub (pinned to 07ec7068a5)

Solutions

  1. Verify the config id exists via getConfigState(providerId)?.configList before resolving its name.
  2. Refresh provider state (hydrate app state) if the config was created recently or modified in another window.
  3. Confirm the (providerId, configId) pair matches — ids are scoped per provider.
  4. Use the return value of createConfig/copyConfig (they return _id) rather than reconstructing ids by hand.

Example fix

// before
const configName = getConfigNameById(providerId, configId)

// after
const exists = getConfigState(providerId)?.configList.some(
  (item) => item._id === configId
)
if (!exists) {
  toast.warning(i18n.t('TIPS_UPLOADER_CONFIG_NOT_FOUND'))
  return
}
const configName = getConfigNameById(providerId, configId)
Defensive patterns

Strategy: validation

Validate before calling

const configItem = getConfigState(providerId)?.configList.find(
  (item) => item._id === configId
)
if (!configItem) {
  // config gone or wrong provider — bail before name lookup
  return
}

Type guard

function configExists(
  item: ProviderConfigItem | undefined
): item is ProviderConfigItem & { _configName: string } {
  return !!item && typeof item._configName === 'string'
}

Try / catch

try {
  const configName = getConfigNameById(providerId, configId)
} catch (err) {
  toast.warning(i18n.t('TIPS_UPLOADER_CONFIG_NOT_FOUND'))
}

Prevention

When it happens

Trigger: Calling getConfigNameById(providerId, configId) where configId was deleted, belongs to a different provider, or the provider's configList has not been loaded into the store yet.

Common situations: A stale configId persisted in UI state after the config was removed in another window; passing the providerId where configId belongs; operating on configs before hydrateAppState() populated the provider store.

Related errors


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