libnyanpasu/clash-nyanpasu · error · Error

Not Support

Error message

Not Support

What it means

TrayIconItem's file dialog is configured for single selection; if the dialog somehow returns an array (multiple selections), the code throws 'Not Support' because multi-select tray icons are not implemented.

Source

Thrown at frontend/nyanpasu/src/pages/(main)/main/settings/nyanpasu/_modules/tray-icon-config.tsx:58

  })

  const [isLoading, setIsLoading] = useState(false)

  const handleChangeIcon = useLockFn(async () => {
    try {
      const selected = await open({
        directory: false,
        multiple: false,
        filters: [
          {
            name: 'Images',
            extensions: ['png', 'jpg', 'jpeg', 'bmp', 'ico'],
          },
        ],
      })

      if (Array.isArray(selected)) {
        throw new Error('Not Support')
      } else if (selected === null) {
        return null
      }

      setIsLoading(true)

      await commands.setTrayIcon(mode, selected)
      await isIconSet.refetch()
      setIconVersion((prev) => prev + 1)

      message(m.settings_nyanpasu_tray_icon_set_success(), {
        kind: 'info',
      })
    } catch (e) {
      console.error(e)
      message(m.settings_nyanpasu_tray_icon_set_failed(), {
        kind: 'error',
      })

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Select exactly one file in the dialog
  2. Pick a single png/jpg/jpeg/bmp/ico file when choosing a custom tray icon
  3. If it persists, reset the tray icon setting to default
Defensive patterns

Strategy: validation

Validate before calling

if (Array.isArray(selected)) {
  showToast('Please select a single icon file')
  return
}

Type guard

const isSingleFile = (v: unknown): v is string => typeof v === 'string'

Try / catch

try {
  await pickTrayIcon()
} catch (e) {
  if (e instanceof Error && e.message === 'Not Support') {
    showToast('Multi-select is not supported for tray icons')
  }
}

Prevention

When it happens

Trigger: Selecting a tray icon file when the dialog result is an array — occurs when the picker is invoked in a way that permits multiple selection or a platform quirk returns a list.

Common situations: Users on platforms/dialog implementations that return arrays from the open dialog trying to set a custom tray icon.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/a87874e8613e70b6. Report an issue: GitHub.