{"record":{"id":"171d94d3b617f5fb","repo":"siyuan-note/siyuan","slug":"marketplace-package-is-incompatible","errorCode":null,"errorMessage":"marketplace package is incompatible","messagePattern":"marketplace package is incompatible","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":112,"sourceCode":"}\n\n// ThemeInstallOptions 描述新安装主题后需要应用的外观模式\ntype ThemeInstallOptions struct {\n\tMode   int\n\tModeOS bool\n}\n\n// LocalBazaarPackageInstallResult 描述本地集市包的识别和安装结果。\ntype LocalBazaarPackageInstallResult struct {\n\tPackageType   string `json:\"packageType\"`\n\tPackageName   string `json:\"packageName\"`\n\tMinAppVersion string `json:\"minAppVersion,omitempty\"`\n\tUpdated       bool   `json:\"updated\"`\n}\n\nvar (\n\tErrLocalBazaarPackageExists       = errors.New(\"marketplace package already exists\")\n\tErrLocalBazaarPackageIncompatible = errors.New(\"marketplace package is incompatible\")\n\tlocalBazaarInstallLock            sync.Mutex\n)\n\n// updatePackages 更新一组集市包；同类型批量更新时，安装后处理只执行一次\nfunc updatePackages(packages []*UpdatedPackage, pkgType string, successCount, failedCount *int, planned int) {\n\titems := make([]batchInstallItem, 0, len(packages))\n\tfor _, updated := range packages {\n\t\tpkg := updated.Available\n\t\tmeta, err := installBazaarPackage(pkgType, pkg.RepoURL, pkg.RepoHash, pkg.RepoRef, pkg.Name)\n\t\tif err != nil {\n\t\t\tlogging.LogErrorf(\"update %s [%s] failed: %s\", pkgType, pkg.Name, err)\n\t\t\tutil.PushErrMsg(fmt.Sprintf(Conf.language(238), pkg.Name), 5000)\n\t\t\t*failedCount++\n\t\t\tcontinue\n\t\t}\n\t\titems = append(items, batchInstallItem{name: pkg.Name, meta: meta})\n\t\t*successCount++\n\t\tutil.PushEndlessProgress(fmt.Sprintf(Conf.language(236), *successCount+*failedCount, planned, pkg.Name))","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/bazaar.go#L94-L130","documentation":"ErrLocalBazaarPackageIncompatible is a sentinel error returned when the package requires a newer SiYuan kernel version than the running app (MinAppVersion check), or when its frontend compatibility check fails (IsIncompatiblePlugin/IsIncompatibleTheme for the current frontend). It may be wrapped with a '%w: SiYuan X or later is required' message. The API layer maps it to reason \"package-incompatible\".","triggerScenarios":"InstallLocalBazaarPackage with a package whose plugin.json/theme.json declares minAppVersion greater than the running kernel version, or whose bazaar metadata marks it incompatible with the current frontend (desktop vs mobile, or an unsupported frontend mode).","commonSituations":"Installing a plugin built for a newer SiYuan release into an older app; installing a desktop-only plugin on mobile; downgrading SiYuan while previously compatible packages are reinstalled from local sources; stale bazaar metadata cached after an app upgrade.","solutions":["Upgrade SiYuan to at least the version stated in the wrapped error message (MinAppVersion)","Pick a package version whose minAppVersion is satisfied by the running app","For frontend incompatibility, use the package on a supported frontend (desktop/mobile) or choose an alternative package","Check errors.Is(err, model.ErrLocalBazaarPackageIncompatible) and surface 'requires SiYuan >= X' to the user instead of a generic failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const appVer = window.siyuan?.config?.appVersion ?? kernelVersion;\nconst manifest = JSON.parse(readFileSync(path.join(src, \"plugin.json\"), \"utf8\"));\nif (manifest.minAppVersion && compareVersions(appVer, manifest.minAppVersion) < 0) {\n  alert(`requires SiYuan >= ${manifest.minAppVersion}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await model.InstallLocalBazaarPackage(src, pkgType, frontend, overwrite);\n} catch (err) {\n  if (errors.Is(err, model.ErrLocalBazaarPackageIncompatible)) {\n    showUpgradePrompt(err) // message includes 'SiYuan X or later is required'\n  }\n}","preventionTips":["Compare the package's minAppVersion against the running kernel before installing","Check the package's bazaar metadata for frontend compatibility (desktop vs mobile)","Keep SiYuan up to date when installing packages from active development branches","Avoid reinstalling local packages after an app downgrade without rechecking compatibility"],"tags":["marketplace","versioning","compatibility"],"backgroundTag":"incompatible-source-type","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}